[FFmpeg-cvslog] hlsproto: Properly close avio buffer in case of error

Vittorio Giovara git at videolan.org
Fri Jan 23 22:38:07 CET 2015


ffmpeg | branch: master | Vittorio Giovara <vittorio.giovara at gmail.com> | Thu Jan 22 20:13:44 2015 +0000| [7915e6741dbe1cf3a8781cead3e68a7666de14f4] | committer: Vittorio Giovara

hlsproto: Properly close avio buffer in case of error

Fix a memory leak.

CC: libav-stable at libav.org
Bug-Id: CID 717999

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

 libavformat/hlsproto.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavformat/hlsproto.c b/libavformat/hlsproto.c
index 751fef2..0eba049 100644
--- a/libavformat/hlsproto.c
+++ b/libavformat/hlsproto.c
@@ -121,8 +121,10 @@ static int parse_playlist(URLContext *h, const char *url)
         return ret;
 
     read_chomp_line(in, line, sizeof(line));
-    if (strcmp(line, "#EXTM3U"))
-        return AVERROR_INVALIDDATA;
+    if (strcmp(line, "#EXTM3U")) {
+        ret = AVERROR_INVALIDDATA;
+        goto fail;
+    }
 
     free_segment_list(s);
     s->finished = 0;



More information about the ffmpeg-cvslog mailing list