ffmpeg | branch: master | Steven Liu <l...@chinaffmpeg.org> | Thu Oct 10 
10:07:50 2019 +0800| [22eae2d0c9fc5d5847bb7b64debe8d4b72fdff01] | committer: 
Steven Liu

avformat/libmodplug: fix memleak when load modplug failed

Signed-off-by: Steven Liu <l...@chinaffmpeg.org>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=22eae2d0c9fc5d5847bb7b64debe8d4b72fdff01
---

 libavformat/libmodplug.c | 5 +++--
 1 file 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);

_______________________________________________
ffmpeg-cvslog mailing list
ffmpeg-cvslog@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
ffmpeg-cvslog-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to