summaryrefslogtreecommitdiff
path: root/libavcodec/mlpdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-20 23:01:03 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-22 19:42:39 +0200
commit42e42af76cff46c4e1a41dd8de992b38880f78be (patch)
tree602dbb0463246c748e31028a3af4dd4287a48bd7 /libavcodec/mlpdec.c
parentda617408c80afd2ea67a175fabc0ba546b9b04bc (diff)
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>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index eac19a0d5e..c0a23c5f0d 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -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,