aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-04-29 20:28:46 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-05-17 02:23:06 +0200
commitb3a18511cc93082ebecce0861bc15d7f548492e0 (patch)
treed95053e607f5a5b64ce9c3dac7730c51fdc6864d /libavcodec
parent9e5d0860c043ba5d1e48c0f8c42b0fe3b6cbeba4 (diff)
downloadffmpeg-b3a18511cc93082ebecce0861bc15d7f548492e0.tar.gz
avcodec/mpeg4videodec: Check bps (VOL header) before VOP for studio profile
Fixes: runtime error: shift exponent -1 is negative Fixes: 7486/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-4977380939530240 Fixes: runtime error: index 36 out of bounds for type 'const uint8_t [32]' Fixes: 7566/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MPEG4_fuzzer-6536620682510336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mpeg4videodec.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 33cdc7a1b2..ada5cdc6fa 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -3217,9 +3217,13 @@ end:
s->low_delay = 1;
s->avctx->has_b_frames = !s->low_delay;
- if (s->studio_profile)
+ if (s->studio_profile) {
+ if (!s->avctx->bits_per_raw_sample) {
+ av_log(s->avctx, AV_LOG_ERROR, "Missing VOL header\n");
+ return AVERROR_INVALIDDATA;
+ }
return decode_studio_vop_header(ctx, gb);
- else
+ } else
return decode_vop_header(ctx, gb);
}