[FFmpeg-cvslog] wtvdec: fix memleak on error

Michael Niedermayer git at videolan.org
Sat Oct 13 03:38:57 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Oct 13 02:37:47 2012 +0200| [e47024d72f326f7a76c9df90da861663fc5d5fc2] | committer: Michael Niedermayer

wtvdec: fix memleak on error

Fixes CID718002
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavformat/wtvdec.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/wtvdec.c b/libavformat/wtvdec.c
index 319b986..a8dc506 100644
--- a/libavformat/wtvdec.c
+++ b/libavformat/wtvdec.c
@@ -580,8 +580,10 @@ static AVStream * new_stream(AVFormatContext *s, AVStream *st, int sid, int code
         if (!wst)
             return NULL;
         st = avformat_new_stream(s, NULL);
-        if (!st)
+        if (!st) {
+            av_free(wst);
             return NULL;
+        }
         st->id = sid;
         st->priv_data = wst;
     }



More information about the ffmpeg-cvslog mailing list