diff --git a/libavformat/riffdec.c b/libavformat/riffdec.c index 88e2229a77..fd3b583af2 100644 --- a/libavformat/riffdec.c +++ b/libavformat/riffdec.c @@ -114,7 +114,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) 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;