mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-08-26 08:26:59 -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
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
@@ -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