From 0e21713267e41452f2264340e4486ed906f46eb1 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Mon, 28 Jan 2019 21:10:18 +0100 Subject: [PATCH] rgb: fix crash in fuzzed file --- src/imageformats/rgb.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/imageformats/rgb.cpp b/src/imageformats/rgb.cpp index a8a6eba..929f9e4 100644 --- a/src/imageformats/rgb.cpp +++ b/src/imageformats/rgb.cpp @@ -144,6 +144,9 @@ bool SGIImage::getRow(uchar *dest) if (_bpc == 2) { _pos++; } + if (_pos >= _data.end()) { + return false; + } n = *_pos & 0x7f; if (!n) { break;