mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-19 04:02:09 +01:00
Fixed broken image dimensions checks
This commit is contained in:
parent
9e1e960c93
commit
e13d6dfc4b
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user