mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-06-03 17:08:08 -04:00
pcx: Fix crash on fuzzed image
This commit is contained in:
parent
03c3c07004
commit
7e86e62e86
@ -325,6 +325,10 @@ static void readImage8(QImage &img, QDataStream &s, const PCXHEADER &header)
|
|||||||
readLine(s, buf, header);
|
readLine(s, buf, header);
|
||||||
|
|
||||||
uchar *p = img.scanLine(y);
|
uchar *p = img.scanLine(y);
|
||||||
|
|
||||||
|
if (!p)
|
||||||
|
return;
|
||||||
|
|
||||||
unsigned int bpl = qMin(header.BytesPerLine, (quint16)header.width());
|
unsigned int bpl = qMin(header.BytesPerLine, (quint16)header.width());
|
||||||
for (unsigned int x = 0; x < bpl; ++x) {
|
for (unsigned int x = 0; x < bpl; ++x) {
|
||||||
p[ x ] = buf[ x ];
|
p[ x ] = buf[ x ];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user