Commit 22eae2d0 authored by Steven Liu's avatar Steven Liu

avformat/libmodplug: fix memleak when load modplug failed

Signed-off-by: 's avatarSteven Liu <lq@chinaffmpeg.org>
parent 1a109fba
...@@ -216,9 +216,10 @@ static int modplug_read_header(AVFormatContext *s) ...@@ -216,9 +216,10 @@ static int modplug_read_header(AVFormatContext *s)
ModPlug_SetSettings(&settings); ModPlug_SetSettings(&settings);
modplug->f = ModPlug_Load(modplug->buf, sz); modplug->f = ModPlug_Load(modplug->buf, sz);
if (!modplug->f) if (!modplug->f) {
av_freep(&modplug->buf);
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
}
st = avformat_new_stream(s, NULL); st = avformat_new_stream(s, NULL);
if (!st) if (!st)
return AVERROR(ENOMEM); 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