diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-12-16 21:43:07 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2019-03-24 10:38:51 +0100 |
commit | d99a3f9792ec2e7c7882203ac31fbefe391ff9f0 (patch) | |
tree | 6c08deb85d3c0da1263a4fe3c14c4bd1455eb5f0 | |
parent | 30046553a5a301cfc12295f2d42e1d40eb075268 (diff) | |
download | ffmpeg-d99a3f9792ec2e7c7882203ac31fbefe391ff9f0.tar.gz |
avcodec/fic: Fail on invalid slice size/off
Fixes: Timeout
Fixes: 11486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FIC_fuzzer-5677133863583744
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 30a7a81cdc2ee2eac6d3271439c43f11b7327b3e)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/fic.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/fic.c b/libavcodec/fic.c index c288c9771b..0b491ef7de 100644 --- a/libavcodec/fic.c +++ b/libavcodec/fic.c @@ -380,6 +380,8 @@ static int fic_decode_frame(AVCodecContext *avctx, void *data, slice_h = FFALIGN(avctx->height - ctx->slice_h * (nslices - 1), 16); } else { slice_size = AV_RB32(src + tsize + FIC_HEADER_SIZE + slice * 4 + 4); + if (slice_size < slice_off) + return AVERROR_INVALIDDATA; } if (slice_size < slice_off || slice_size > msize) |