提交 22eae2d0 编写于 作者: S Steven Liu

avformat/libmodplug: fix memleak when load modplug failed

Signed-off-by: NSteven Liu <lq@chinaffmpeg.org>
上级 1a109fba
......@@ -216,9 +216,10 @@ static int modplug_read_header(AVFormatContext *s)
ModPlug_SetSettings(&settings);
modplug->f = ModPlug_Load(modplug->buf, sz);
if (!modplug->f)
if (!modplug->f) {
av_freep(&modplug->buf);
return AVERROR_INVALIDDATA;
}
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册