mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-21 12:44:20 -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;
|
||||
}
|
||||
|
||||
if (header.BytesPerLine < (header.width() / 8)) {
|
||||
if (header.BytesPerLine < (header.width() + 7) / 8) {
|
||||
qWarning() << "PCX image has invalid BytesPerLine value";
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user