[FFmpeg-devel] [PATCH 6/9] avcodec/adpcm: Set vqa_version before use in init

Andreas Rheinhardt andreas.rheinhardt at outlook.com
Thu May 13 03:50:07 EEST 2021


Michael Niedermayer:
> 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 at niedermayer.cc>
> ---
>  libavcodec/adpcm.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c
> index be14607eac..2deefeb651 100644
> --- a/libavcodec/adpcm.c
> +++ b/libavcodec/adpcm.c
> @@ -191,6 +191,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;
> 
I think this was unnecessary, as it has already been fixed in
ff946633a30e15415974c3f0ec7751c04eb91701.

- Andreas


More information about the ffmpeg-devel mailing list