diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-16 00:13:14 +0300 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-02-10 01:33:18 +0300 |
commit | cce37a22bc319c4b9e49d2b907841d9ec3f98c56 (patch) | |
tree | db16b0d936267aca4a2b38f7e2b91ea5cc08edfb /libavcodec/mvha.c | |
parent | a98eeb0c1e867238905ed095b48184f706adf328 (diff) |
avcodec/mvha: Check remaining bits in VLC decode loop
Fixes: timeout (252sec -> 170msec)
Fixes: 20023/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5681192565473280
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/mvha.c')
-rw-r--r-- | libavcodec/mvha.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mvha.c b/libavcodec/mvha.c index 1ea3bb3d76..c603ef6975 100644 --- a/libavcodec/mvha.c +++ b/libavcodec/mvha.c @@ -233,6 +233,8 @@ static int decode_frame(AVCodecContext *avctx, dst = frame->data[p] + (avctx->height - 1) * frame->linesize[p]; for (int y = 0; y < avctx->height; y++) { + if (get_bits_left(gb) < width) + return AVERROR_INVALIDDATA; for (int x = 0; x < width; x++) { int v = get_vlc2(gb, s->vlc.table, s->vlc.bits, 3); |