From 80f5bbfbce0716b179e506762c161e1b6595a4df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 1 Nov 2020 23:47:44 +0100 Subject: [PATCH] Print a warning on invalid subdiv bounds --- src/map/IMG/trefile.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/map/IMG/trefile.cpp b/src/map/IMG/trefile.cpp index a8dbd5d0..abdffb43 100644 --- a/src/map/IMG/trefile.cpp +++ b/src/map/IMG/trefile.cpp @@ -202,8 +202,12 @@ bool TREFile::load(int idx) double min[2], max[2]; RectC bounds(Coordinates(LB(lon - width), toWGS24(lat + height)), Coordinates(RB(lon + width), toWGS24(lat - height))); - if (!bounds.isValid()) + if (!bounds.isValid()) { + qWarning("%s: invalid subdiv bounds (level %d; pos %f,%f; size %fx%f)", + qPrintable(fileName()), level.level, toWGS24(lon), toWGS24(lat), + toWGS24(width), toWGS24(height)); goto error; + } min[0] = bounds.left(); min[1] = bounds.bottom();