提交 ed8a5006 编写于 作者: A Alex Converse

riff: Fix potential memleak.

Make ff_get_wav_header() free existing extradata before allocing a new
buffer.
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册