[FFmpeg-cvslog] avcodec/fic: Check available input space for cursor

Michael Niedermayer git at videolan.org
Tue Jul 10 12:05:19 EEST 2018


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Sat May  5 22:00:01 2018 +0200| [888bdb127b545731148d7f678f69c863a55889a8] | committer: Michael Niedermayer

avcodec/fic: Check available input space for cursor

Fixes: out of array read
Fixes: 6546/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-6317064647081984

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit cb2f7ea96b4f6e03ebf0c0563677745fc65f148e)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=888bdb127b545731148d7f678f69c863a55889a8
---

 libavcodec/fic.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/fic.c b/libavcodec/fic.c
index 6940cb6231..7bfb998a55 100644
--- a/libavcodec/fic.c
+++ b/libavcodec/fic.c
@@ -334,6 +334,10 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data,
         skip_cursor = 1;
     }
 
+    if (!skip_cursor && avpkt->size < CURSOR_OFFSET + sizeof(ctx->cursor_buf)) {
+        skip_cursor = 1;
+    }
+
     /* Slice height for all but the last slice. */
     ctx->slice_h = 16 * (ctx->aligned_height >> 4) / nslices;
     if (ctx->slice_h % 16)



More information about the ffmpeg-cvslog mailing list