[FFmpeg-devel] [PATCH 2/2] avcodec/wmv2dec: Skip I frame if its smaller than 1/8 of the minimal size

Michael Niedermayer michael at niedermayer.cc
Wed Nov 28 02:46:50 EET 2018


Fixes: Timeout
Fixes: 11168/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMV2_fuzzer-5733782032744448

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

diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c
index 4f97d9227c..1858dc15c6 100644
--- a/libavcodec/wmv2dec.c
+++ b/libavcodec/wmv2dec.c
@@ -181,6 +181,8 @@ int ff_wmv2_decode_secondary_picture_header(MpegEncContext *s)
             }
 
             s->dc_table_index = get_bits1(&s->gb);
+            if (get_bits_left(&s->gb) * 8LL < (s->width+15)/16 * ((s->height+15)/16))
+                return AVERROR_INVALIDDATA;
         }
         s->inter_intra_pred = 0;
         s->no_rounding      = 1;
-- 
2.19.2



More information about the ffmpeg-devel mailing list