[FFmpeg-devel] [PATCH 2/3] avcodec/adpcm: Fix invalid shifts in ADPCM DTK
Paul B Mahol
onemda at gmail.com
Mon Oct 28 20:21:42 EET 2019
Trivial change, LGTM
On 10/28/19, Michael Niedermayer <michael at niedermayer.cc> wrote:
> 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
> Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> ---
> libavcodec/adpcm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> index a8e74522b3..53d8d0be6a 100644
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -1723,7 +1723,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx,
> void *data,
> else
> 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);
> c->status[channel].sample2 =
> c->status[channel].sample1;
> c->status[channel].sample1 = sampledat;
> --
> 2.23.0
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".
More information about the ffmpeg-devel
mailing list