[FFmpeg-cvslog] r11349 - trunk/libavformat/matroskadec.c

aurel subversion
Sat Dec 29 19:30:27 CET 2007


Author: aurel
Date: Sat Dec 29 19:30:27 2007
New Revision: 11349

Log:
fix memory leak (patch by Gabriel Fort?  gforte _at_ wyplay _dot_ com)

Modified:
   trunk/libavformat/matroskadec.c

Modified: trunk/libavformat/matroskadec.c
==============================================================================
--- trunk/libavformat/matroskadec.c	(original)
+++ trunk/libavformat/matroskadec.c	Sat Dec 29 19:30:27 2007
@@ -2268,8 +2268,10 @@ matroska_parse_block(MatroskaDemuxContex
         av_free(origdata);
         return res;
     }
-    if (matroska->tracks[track]->stream_index < 0)
+    if (matroska->tracks[track]->stream_index < 0) {
+        av_free(origdata);
         return res;
+    }
     st = matroska->ctx->streams[matroska->tracks[track]->stream_index];
     if (st->discard >= AVDISCARD_ALL) {
         av_free(origdata);
@@ -2287,8 +2289,10 @@ matroska_parse_block(MatroskaDemuxContex
         is_keyframe = flags & 0x80 ? PKT_FLAG_KEY : 0;
 
     if (matroska->skip_to_keyframe) {
-        if (!is_keyframe || st != matroska->skip_to_stream)
+        if (!is_keyframe || st != matroska->skip_to_stream) {
+            av_free(origdata);
             return res;
+        }
         matroska->skip_to_keyframe = 0;
     }
 




More information about the ffmpeg-cvslog mailing list