mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Added missing data validity checks
This commit is contained in:
parent
c339116cd1
commit
ff015c8714
@ -121,7 +121,10 @@ int OfflineMap::parse(QIODevice &device, QList<ReferencePoint> &points,
|
||||
p.xy = QPoint(x, y);
|
||||
if (ll) {
|
||||
p.ll = Coordinates(lond + lonm/60.0, latd + latm/60.0);
|
||||
points.append(p);
|
||||
if (p.ll.isValid())
|
||||
points.append(p);
|
||||
else
|
||||
return ln;
|
||||
} else if (pp) {
|
||||
p.pp = QPointF(ppx, ppy);
|
||||
setup.zone = zone;
|
||||
@ -205,6 +208,14 @@ bool OfflineMap::createProjection(const QString &datum,
|
||||
return false;
|
||||
}
|
||||
|
||||
if (setup.latitudeOrigin < -90.0 || setup.latitudeOrigin > 90.0
|
||||
|| setup.longitudeOrigin < -180.0 || setup.longitudeOrigin > 180.0
|
||||
|| setup.standardParallel1 < -90 || setup.standardParallel1 > 90
|
||||
|| setup.standardParallel2 < -90 || setup.standardParallel2 > 90) {
|
||||
_errorString = "Invalid projection setup";
|
||||
return false;
|
||||
}
|
||||
|
||||
if (projection == "Mercator")
|
||||
_projection = new Mercator();
|
||||
else if (projection == "Transverse Mercator")
|
||||
|
Loading…
Reference in New Issue
Block a user