[FFmpeg-cvslog] avcodec/flicvideo: Check remaining bytes in FLI*COPY

Michael Niedermayer git at videolan.org
Wed Oct 6 13:20:54 EEST 2021


ffmpeg | branch: release/4.1 | Michael Niedermayer <michael at niedermayer.cc> | Tue Sep 14 20:31:39 2021 +0200| [800e7d83e8e4d87d935d7da50037f2d5f931fcee] | committer: Michael Niedermayer

avcodec/flicvideo: Check remaining bytes in FLI*COPY

Fixes: Timeout
Fixes: 37795/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FLIC_fuzzer-4846536543043584

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 5f835efbca874ad42cb954e6788588f52a57a7a2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavcodec/flicvideo.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index bf8ffeba4f..bf095f7461 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -735,6 +735,8 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
                 bytestream2_skip(&g2, chunk_size - 6);
             } else {
 
+                if (bytestream2_get_bytes_left(&g2) < 2 * s->avctx->width * s->avctx->height )
+                    return AVERROR_INVALIDDATA;
                 for (y_ptr = 0; y_ptr < s->frame->linesize[0] * s->avctx->height;
                      y_ptr += s->frame->linesize[0]) {
 



More information about the ffmpeg-cvslog mailing list