mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-14 02:54:19 -04:00
Fix crash on malformed files
Co-authored-by: Mirco Miranda <mircomir@gmail.com>
This commit is contained in:
@ -308,7 +308,7 @@ static bool readImage4(QImage &img, QDataStream &s, const PCXHEADER &header)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (header.BytesPerLine < (header.width() / 8)) {
|
if (header.BytesPerLine < (header.width() + 7) / 8) {
|
||||||
qWarning() << "PCX image has invalid BytesPerLine value";
|
qWarning() << "PCX image has invalid BytesPerLine value";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user