1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

avcodec/adpcm: init from extradata before setting sample formats

Fixes a crash when decoding VQA files.

Regression since c012f9b265.

Reported-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
This commit is contained in:
Zane van Iperen 2021-04-25 11:27:41 +10:00
parent d98884be41
commit ff946633a3
No known key found for this signature in database
GPG Key ID: 68616B2D8AC4DCC5

View File

@ -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;
}