Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2020-06-20 13:59:14 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-06-26 22:47:13 +0300
commitb35968e06078c452cac562e016df5b39c3945176 (patch)
tree16b4f7ba03abf3bb4601780a9a365714e4c39a63 /libavcodec/adpcm.c
parenta705bcd763e344fac191e157ffeddc285388b7fa (diff)
avcodec/adpcm_ima_apm: support new extradata format
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/adpcm.c')
-rw-r--r--libavcodec/adpcm.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 79c5d625d1..4de4a23289 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -162,11 +162,18 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
}
break;
case AV_CODEC_ID_ADPCM_IMA_APM:
- if (avctx->extradata && avctx->extradata_size >= 16) {
- c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 0), 18);
- c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88);
- c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 8), 18);
- c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88);
+ if (avctx->extradata) {
+ if (avctx->extradata_size >= 28) {
+ c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 16), 18);
+ c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 20), 0, 88);
+ c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 4), 18);
+ c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 8), 0, 88);
+ } else if (avctx->extradata_size >= 16) {
+ c->status[0].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 0), 18);
+ c->status[0].step_index = av_clip(AV_RL32(avctx->extradata + 4), 0, 88);
+ c->status[1].predictor = av_clip_intp2(AV_RL32(avctx->extradata + 8), 18);
+ c->status[1].step_index = av_clip(AV_RL32(avctx->extradata + 12), 0, 88);
+ }
}
break;
case AV_CODEC_ID_ADPCM_IMA_WS: