diff mbox series

[FFmpeg-devel,v2,3/7] avcodec/adpcm_ima_apm: prepare extradata handling for encoder

Message ID 20200610233155.1050210-4-zane@zanevaniperen.com
State Superseded
Headers show
Series adpcm_ima_apm encoder + apm muxer
Related show

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Zane van Iperen June 10, 2020, 11:32 p.m. UTC
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
---
 libavcodec/adpcm.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index 79c5d625d1..328971adf1 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -162,11 +162,11 @@  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 && 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);
         }
         break;
     case AV_CODEC_ID_ADPCM_IMA_WS: