mirror of
https://git.ffmpeg.org/ffmpeg.git
synced 2025-01-28 18:23:08 +00:00
avcodec/adpcm: Set vqa_version before use in init
Fixes: null pointer dereference Fixes: 33172/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_WS_fuzzer-5200164273913856 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
38c4761588
commit
7a403da0cb
@ -193,6 +193,8 @@ static av_cold int adpcm_decode_init(AVCodecContext * avctx)
|
||||
avctx->sample_fmt = AV_SAMPLE_FMT_S16P;
|
||||
break;
|
||||
case AV_CODEC_ID_ADPCM_IMA_WS:
|
||||
if (avctx->extradata && avctx->extradata_size >= 2)
|
||||
c->vqa_version = AV_RL16(avctx->extradata);
|
||||
avctx->sample_fmt = c->vqa_version == 3 ? AV_SAMPLE_FMT_S16P :
|
||||
AV_SAMPLE_FMT_S16;
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user