From 1225d350d41368ddafff8f7ac5ebc5d2992b455a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 2 Nov 2020 00:18:27 +0100 Subject: [PATCH] Allow broken subdiv bounds produced by mkgmap --- 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 abdffb43..2efdd532 100644 --- a/src/map/IMG/trefile.cpp +++ b/src/map/IMG/trefile.cpp @@ -206,7 +206,11 @@ bool TREFile::load(int idx) 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; + /* mkgmap produces invalid (zero width or/and zero height) subdiv + bounds in some cases. Allow such bounds as they should not break + things. */ + if (!(!width || !height)) + goto error; } min[0] = bounds.left();