summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorZane van Iperen <zane@zanevaniperen.com>2021-04-25 11:27:41 +1000
committerZane van Iperen <zane@zanevaniperen.com>2021-04-25 21:32:26 +1000
commitff946633a30e15415974c3f0ec7751c04eb91701 (patch)
treec0a4688b5540b501ed9af898cb83f8c951e4eff8 /libavcodec
parentd98884be41284aedada73e503dc6b8a67877b6b2 (diff)
avcodec/adpcm: init from extradata before setting sample formats
Fixes a crash when decoding VQA files. Regression since c012f9b265e172de9c240c9dfab8665936fa3e83. Reported-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/adpcm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
index be14607eac..b031e24981 100644
--- a/libavcodec/adpcm.c
+++ b/libavcodec/adpcm.c
@@ -111,6 +111,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
unsigned int min_channels = 1;
unsigned int max_channels = 2;
+ adpcm_flush(avctx);
+
switch(avctx->codec->id) {
case AV_CODEC_ID_ADPCM_IMA_AMV:
max_channels = 1;
@@ -201,8 +203,6 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
default:
avctx->sample_fmt = AV_SAMPLE_FMT_S16;
}
-
- adpcm_flush(avctx);
return 0;
}