You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-30 22:24:04 +02:00
avcodec/adpcm: Clip predictor for APC
Fixes: signed integer overflow: -2147483648 - 13 cannot be represented in type 'int'
Fixes: 18893/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_APC_fuzzer-5630760442920960
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 9fe07908c3
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
@ -127,8 +127,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
|
|||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_ADPCM_IMA_APC:
|
case AV_CODEC_ID_ADPCM_IMA_APC:
|
||||||
if (avctx->extradata && avctx->extradata_size >= 8) {
|
if (avctx->extradata && avctx->extradata_size >= 8) {
|
||||||
c->status[0].predictor = AV_RL32(avctx->extradata);
|
c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata ), 18);
|
||||||
c->status[1].predictor = AV_RL32(avctx->extradata + 4);
|
c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 4), 18);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AV_CODEC_ID_ADPCM_IMA_WS:
|
case AV_CODEC_ID_ADPCM_IMA_WS:
|
||||||
|
Reference in New Issue
Block a user