diff options
author | Steven Liu <lq@chinaffmpeg.org> | 2019-10-10 10:07:50 +0800 |
---|---|---|
committer | Steven Liu <lq@chinaffmpeg.org> | 2019-10-28 14:26:07 +0800 |
commit | 22eae2d0c9fc5d5847bb7b64debe8d4b72fdff01 (patch) | |
tree | a569a205b473f2e3c1a6c486ad495d77c17f2e8e /libavformat/libmodplug.c | |
parent | 1a109fba5499f95d3d0cc526a912f9e71446c812 (diff) | |
download | ffmpeg-22eae2d0c9fc5d5847bb7b64debe8d4b72fdff01.tar.gz |
avformat/libmodplug: fix memleak when load modplug failed
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
Diffstat (limited to 'libavformat/libmodplug.c')
-rw-r--r-- | libavformat/libmodplug.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libavformat/libmodplug.c b/libavformat/libmodplug.c index 314bdae3e7..d4f78d99b1 100644 --- a/libavformat/libmodplug.c +++ b/libavformat/libmodplug.c @@ -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); |