Browse Source

avcodec/mvha: Check remaining space when reading VLC table probabilities

Fixes: Infinite loop
Fixes: 19183/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_MVHA_fuzzer-5666216765292544

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 6 years ago
parent
commit
e7011a0ca6
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      libavcodec/mvha.c

+ 3
- 0
libavcodec/mvha.c View File

@@ -203,6 +203,9 @@ static int decode_frame(AVCodecContext *avctx,
for (int i = 0; i < s->nb_symbols; symbol++) {
int prob;

if (get_bits_left(gb) < 4)
return AVERROR_INVALIDDATA;

if (get_bits1(gb)) {
prob = get_bits(gb, 12);
} else {


Loading…
Cancel
Save