mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2025-05-28 00:30:23 -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);
|
||||
|
||||
uchar *p = img.scanLine(y);
|
||||
|
||||
if (!p)
|
||||
return;
|
||||
|
||||
unsigned int bpl = qMin(header.BytesPerLine, (quint16)header.width());
|
||||
for (unsigned int x = 0; x < bpl; ++x) {
|
||||
p[ x ] = buf[ x ];
|
||||
|
Loading…
Reference in New Issue
Block a user