avformat/libmodplug: fix memleak when load modplug failed
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
parent
1a109fba54
commit
22eae2d0c9
@ -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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user