rgb: Fix Heap-buffer-overflow in fuzzed file

oss-fuzz/12757
This commit is contained in:
Albert Astals Cid 2019-01-29 10:54:25 +01:00
parent ac725cca68
commit 4751e897ce

View File

@ -153,7 +153,7 @@ bool SGIImage::getRow(uchar *dest)
} }
if (*_pos++ & 0x80) { if (*_pos++ & 0x80) {
for (; i < _xsize && n--; i++) { for (; i < _xsize && _pos < _data.end() && n--; i++) {
*dest++ = *_pos; *dest++ = *_pos;
_pos += _bpc; _pos += _bpc;
} }