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

Fixed broken image dimensions checks

This commit is contained in:
Martin Tůma 2023-12-29 18:01:28 +01:00
parent 9e1e960c93
commit e13d6dfc4b

View File

@ -41,13 +41,13 @@ bool GmiFile::parse(QIODevice &device)
_image = line.trimmed(); _image = line.trimmed();
else if (ln == 3) { else if (ln == 3) {
width = line.toInt(&ok); width = line.toInt(&ok);
if (!ok || ok <= 0) { if (!ok || width <= 0) {
_errorString = "Invalid image width"; _errorString = "Invalid image width";
return false; return false;
} }
} else if (ln == 4) { } else if (ln == 4) {
height = line.toInt(&ok); height = line.toInt(&ok);
if (!ok || ok <= 0) { if (!ok || height <= 0) {
_errorString = "Invalid image height"; _errorString = "Invalid image height";
return false; return false;
} }