mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 19:55:53 +01:00
Added missing error checks
This commit is contained in:
parent
a6e522d758
commit
fad3f116f5
@ -102,6 +102,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
|||||||
} else
|
} else
|
||||||
return ln;
|
return ln;
|
||||||
} else if (key == "IWH") {
|
} else if (key == "IWH") {
|
||||||
|
if (list.count() < 4)
|
||||||
|
return ln;
|
||||||
int w = list.at(2).trimmed().toInt(&res);
|
int w = list.at(2).trimmed().toInt(&res);
|
||||||
if (!res)
|
if (!res)
|
||||||
return ln;
|
return ln;
|
||||||
@ -110,6 +112,8 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
|||||||
return ln;
|
return ln;
|
||||||
_size = QSize(w, h);
|
_size = QSize(w, h);
|
||||||
} else if (key == "Map Projection") {
|
} else if (key == "Map Projection") {
|
||||||
|
if (list.count() < 2)
|
||||||
|
return ln;
|
||||||
projection = list.at(1);
|
projection = list.at(1);
|
||||||
} else if (key == "Projection Setup") {
|
} else if (key == "Projection Setup") {
|
||||||
if (list.count() < 8)
|
if (list.count() < 8)
|
||||||
|
Loading…
Reference in New Issue
Block a user