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:
parent
d98884be41
commit
ff946633a3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user