1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-24 11:45:53 +01:00

Use kB in the chache size arithmetics to prevent integer overflow

This commit is contained in:
Martin Tůma 2024-04-27 12:15:06 +02:00
parent 4445976cb9
commit bd37521ca0

View File

@ -75,7 +75,7 @@ DEM::TileCache DEM::_data;
void DEM::setCacheSize(int size)
{
_data.setMaxCost(size * 1024);
_data.setMaxCost(size);
}
void DEM::setDir(const QString &path)
@ -138,7 +138,7 @@ double DEM::elevation(const Coordinates &c)
if (!e) {
e = loadTile(tile);
ele = height(c, e);
_data.insert(tile, e, e->data().size());
_data.insert(tile, e, e->data().size() / 1024);
} else
ele = height(c, e);