diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index edaf146d1c..f44df1e672 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -132,7 +132,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size, int big_ size -= 22; } if (cbSize > 0) { - av_free(codec->extradata); + av_freep(&codec->extradata); if (ff_get_extradata(codec, pb, cbSize) < 0) return AVERROR(ENOMEM); size -= cbSize;