[FFmpeg-devel] [PATCH 1/2] avcodec/diracdec: Check for arith decoder errors in dirac_unpack_block_motion_data()

Michael Niedermayer michael at niedermayer.cc
Mon May 13 00:21:48 EEST 2019


Fixes: Timeout (54sec -> 188ms)
Fixes: 14585/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DIRAC_fuzzer-5649933052411904

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/diracdec.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/diracdec.c b/libavcodec/diracdec.c
index a5bb6d5f34..52a1951690 100644
--- a/libavcodec/diracdec.c
+++ b/libavcodec/diracdec.c
@@ -1551,6 +1551,11 @@ static int dirac_unpack_block_motion_data(DiracContext *s)
                 }
         }
 
+    for (i = 0; i < 4 + 2*s->num_refs; i++) {
+        if (arith[i].error)
+            return arith[i].error;
+    }
+
     return 0;
 }
 
-- 
2.21.0



More information about the ffmpeg-devel mailing list