pcx: Fix crash on fuzzed image

This commit is contained in:
Albert Astals Cid 2019-01-28 21:40:42 +01:00
parent 03c3c07004
commit 7e86e62e86

View File

@ -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 ];