avcodec/ilbcdec: Check startindex
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 20 Oct 2018 22:35:12 +0000 (00:35 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 22 Oct 2018 22:51:55 +0000 (00:51 +0200)
Fixes: Out of array read
Fixes: 10789/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ILBC_fuzzer-5153255445757952

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ilbcdec.c

index 8f234b9..8a6dbe0 100644 (file)
@@ -1372,7 +1372,7 @@ static int ilbc_decode_frame(AVCodecContext *avctx, void *data,
 
     if (unpack_frame(s))
         mode = 0;
-    if (s->frame.start < 1)
+    if (s->frame.start < 1 || s->frame.start > 5)
         mode = 0;
 
     if (mode) {