Browse Source

avcodec/adpcm: Fix invalid shift in xa_decode()

Fixes: left shift of negative value -1
Fixes: 18859/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_XA_fuzzer-5748474213040128

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n4.3
Michael Niedermayer 6 years ago
parent
commit
50db30b47d
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/adpcm.c

+ 2
- 2
libavcodec/adpcm.c View File

@@ -441,7 +441,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1,
d = in[16+i+j*4];

t = sign_extend(d, 4);
s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
s = t*(1<<shift) + ((s_1*f0 + s_2*f1+32)>>6);
s_2 = s_1;
s_1 = av_clip_int16(s);
out0[j] = s_1;
@@ -468,7 +468,7 @@ static int xa_decode(AVCodecContext *avctx, int16_t *out0, int16_t *out1,
d = in[16+i+j*4];

t = sign_extend(d >> 4, 4);
s = ( t<<shift ) + ((s_1*f0 + s_2*f1+32)>>6);
s = t*(1<<shift) + ((s_1*f0 + s_2*f1+32)>>6);
s_2 = s_1;
s_1 = av_clip_int16(s);
out1[j] = s_1;


Loading…
Cancel
Save