Browse Source

avcodec/mlpdec: Fix runtime error: shift exponent -5 is negative

Fixes part of 1708/clusterfuzz-testcase-minimized-5035111957397504

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

+ 6
- 1
libavcodec/mlpdec.c View File

@@ -861,8 +861,13 @@ static int read_decoding_params(MLPDecodeContext *m, GetBitContext *gbp,

if (s->param_presence_flags & PARAM_OUTSHIFT)
if (get_bits1(gbp)) {
for (ch = 0; ch <= s->max_matrix_channel; ch++)
for (ch = 0; ch <= s->max_matrix_channel; ch++) {
s->output_shift[ch] = get_sbits(gbp, 4);
if (s->output_shift[ch] < 0) {
avpriv_request_sample(m->avctx, "Negative output_shift");
s->output_shift[ch] = 0;
}
}
if (substr == m->max_decoded_substream)
m->dsp.mlp_pack_output = m->dsp.mlp_select_pack_output(s->ch_assign,
s->output_shift,


Loading…
Cancel
Save