mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-12-11 17:30:00 +01:00
avcodec/adpcm: Fix invalid shifts in ADPCM DTK
Fixes: left shift of negative value -1
Fixes: 18397/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_DTK_fuzzer-5675653487132672
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>
(cherry picked from commit 34e701ff93)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@@ -1637,7 +1637,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, void *data,
|
|||||||
else
|
else
|
||||||
sampledat = sign_extend(byte >> 4, 4);
|
sampledat = sign_extend(byte >> 4, 4);
|
||||||
|
|
||||||
sampledat = (((sampledat << 12) >> (header & 0xf)) << 6) + prev;
|
sampledat = ((sampledat * (1 << 12)) >> (header & 0xf)) * (1 << 6) + prev;
|
||||||
*samples++ = av_clip_int16(sampledat >> 6);
|
*samples++ = av_clip_int16(sampledat >> 6);
|
||||||
c->status[channel].sample2 = c->status[channel].sample1;
|
c->status[channel].sample2 = c->status[channel].sample1;
|
||||||
c->status[channel].sample1 = sampledat;
|
c->status[channel].sample1 = sampledat;
|
||||||
|
|||||||
Reference in New Issue
Block a user