Commit ed8a5006 authored by Alex Converse's avatar Alex Converse

riff: Fix potential memleak.

Make ff_get_wav_header() free existing extradata before allocing a new
buffer.
parent dbd31839
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment