Browse Source

avcodec/lagarith: Check scale_factor

Fixes: 1425/clusterfuzz-testcase-minimized-6295712339853312

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.4
Michael Niedermayer 8 years ago
parent
commit
ed3c9b5b0d
1 changed files with 3 additions and 1 deletions
  1. +3
    -1
      libavcodec/lagarith.c

+ 3
- 1
libavcodec/lagarith.c View File

@@ -191,7 +191,9 @@ static int lag_read_prob_header(lag_rac *rac, GetBitContext *gb)
}

scale_factor++;
cumulative_target = 1 << scale_factor;
if (scale_factor >= 32U)
return AVERROR_INVALIDDATA;
cumulative_target = 1U << scale_factor;

if (scaled_cumul_prob > cumulative_target) {
av_log(rac->avctx, AV_LOG_ERROR,


Loading…
Cancel
Save