[FFmpeg-devel] [PATCH 3/3] avcodec/fic: Check that there is input left in fic_decode_block()

Michael Niedermayer michael at niedermayer.cc
Wed Jan 23 03:10:20 EET 2019


Fixes: Timeout
Fixes: 12450/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5661984622641152

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/fic.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 8833536330..65d102b86b 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -139,6 +139,9 @@ static int fic_decode_block(FICContext *ctx, GetBitContext *gb,
 {
     int i, num_coeff;
 
+    if (get_bits_left(gb) < 8)
+        return AVERROR_INVALIDDATA;
+
     /* Is it a skip block? */
     if (get_bits1(gb)) {
         *is_p = 1;
-- 
2.20.1



More information about the ffmpeg-devel mailing list