Fixes: infinite loop
Fixes: 
33674/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_TIFF_fuzzer-4816457818046464

Found-by: continuous fuzzing process 
https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <mich...@niedermayer.cc>
---
 libavcodec/faxcompr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/faxcompr.c b/libavcodec/faxcompr.c
index 7bf11d80ca..f1f7e67762 100644
--- a/libavcodec/faxcompr.c
+++ b/libavcodec/faxcompr.c
@@ -213,7 +213,7 @@ static int decode_group3_1d_line(AVCodecContext *avctx, 
GetBitContext *gb,
         run += t;
         if (t < 64) {
             *runs++ = run;
-            if (runs >= runend) {
+            if (runs >= runend || t < 0) {
                 av_log(avctx, AV_LOG_ERROR, "Run overrun\n");
                 return AVERROR_INVALIDDATA;
             }
-- 
2.17.1

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to