From ed8a50068caacf722b6c7a81f77abcadc134e544 Mon Sep 17 00:00:00 2001 From: Alex Converse Date: Thu, 9 Jun 2011 09:50:38 -0700 Subject: riff: Fix potential memleak. Make ff_get_wav_header() free existing extradata before allocing a new buffer. --- libavformat/riff.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libavformat/riff.c') diff --git a/libavformat/riff.c b/libavformat/riff.c index e17980a00a..fe6cc55055 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -509,6 +509,7 @@ int ff_get_wav_header(AVIOContext *pb, AVCodecContext *codec, int size) } codec->extradata_size = cbSize; if (cbSize > 0) { + av_free(codec->extradata); codec->extradata = av_mallocz(codec->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE); if (!codec->extradata) return AVERROR(ENOMEM); -- cgit v1.2.3