diff options
author | Michael Niedermayer <[email protected]> | 2021-09-14 20:31:39 +0200 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2021-10-17 21:34:53 +0200 |
commit | bc621ecfbd904cd625c3339eb5179980d1b2e371 (patch) | |
tree | d5afbaa66f8e29bdafdca4a6fa455d61cb60730e | |
parent | 529ac57be53da4027038aa45a329e60bc7371958 (diff) |
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 <[email protected]>
(cherry picked from commit 5f835efbca874ad42cb954e6788588f52a57a7a2)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavcodec/flicvideo.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 10c590b215..9788b6853b 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -732,6 +732,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]) { |