aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-07-02 01:26:44 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-10-23 01:44:40 +0200
commit438e848b65c2f46fcc09a3809b711e12a6fc240b (patch)
treeb9f4953c27f1f386c316d0e14282ebb6f12c1e7b
parent21a65701581dba4f48f98b699817f126dd0da51f (diff)
downloadffmpeg-438e848b65c2f46fcc09a3809b711e12a6fc240b.tar.gz
avcodec/indeo4: Check for end of bitstream in decode_mb_info()
Fixes: Timeout Fixes: 8776/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_INDEO4_fuzzer-5361788798369792 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 267ba2aa96354c5b6a1ea89b2943fbd7a4893862) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/indeo4.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/indeo4.c b/libavcodec/indeo4.c
index 13fc42ecde..b2d3cd5f4b 100644
--- a/libavcodec/indeo4.c
+++ b/libavcodec/indeo4.c
@@ -505,6 +505,11 @@ static int decode_mb_info(IVI45DecContext *ctx, IVIBandDesc *band,
mb->b_mv_x =
mb->b_mv_y = 0;
+ if (get_bits_left(&ctx->gb) < 1) {
+ av_log(avctx, AV_LOG_ERROR, "Insufficient input for mb info\n");
+ return AVERROR_INVALIDDATA;
+ }
+
if (get_bits1(&ctx->gb)) {
if (ctx->frame_type == IVI4_FRAMETYPE_INTRA) {
av_log(avctx, AV_LOG_ERROR, "Empty macroblock in an INTRA picture!\n");