mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -04:00
pcx: fix crash on invalid files
Added new PCX testfile for readtest.
This commit is contained in:
parent
a497ab789b
commit
638fdfcbdd
BIN
autotests/read/pcx/16color.pcx
Normal file
BIN
autotests/read/pcx/16color.pcx
Normal file
Binary file not shown.
BIN
autotests/read/pcx/16color.png
Normal file
BIN
autotests/read/pcx/16color.png
Normal file
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;
|
||||
|
Loading…
Reference in New Issue
Block a user