mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-07-20 20:34:17 -04:00
pcx: fix crash on invalid files
Added new PCX testfile for readtest.
This commit is contained in:
committed by
Albert Astals Cid
parent
a497ab789b
commit
638fdfcbdd
@ -308,6 +308,11 @@ static bool readImage4(QImage &img, QDataStream &s, const PCXHEADER &header)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (header.BytesPerLine < (header.width() / 8)) {
|
||||
qWarning() << "PCX image has invalid BytesPerLine value";
|
||||
return false;
|
||||
}
|
||||
|
||||
for (int y = 0; y < header.height(); ++y) {
|
||||
if (s.atEnd()) {
|
||||
return false;
|
||||
|
Reference in New Issue
Block a user