1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 14:53:21 +02:00

Added missing error checks

This commit is contained in:
Martin Tůma 2017-07-27 19:45:04 +02:00
parent a6e522d758
commit fad3f116f5

View File

@ -102,6 +102,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
} else
return ln;
} else if (key == "IWH") {
if (list.count() < 4)
return ln;
int w = list.at(2).trimmed().toInt(&res);
if (!res)
return ln;
@ -110,6 +112,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
return ln;
_size = QSize(w, h);
} else if (key == "Map Projection") {
if (list.count() < 2)
return ln;
projection = list.at(1);
} else if (key == "Projection Setup") {
if (list.count() < 8)