[MPlayer-cvslog] r20160 - trunk/libmpdemux/demux_mkv.c

reimar subversion at mplayerhq.hu
Wed Oct 11 17:47:37 CEST 2006


Author: reimar
Date: Wed Oct 11 17:47:37 2006
New Revision: 20160

Modified:
   trunk/libmpdemux/demux_mkv.c

Log:
Avoid memleak on error while reading attachments or multiple
MATROSKA_ID_FILEDATA parts.


Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Wed Oct 11 17:47:37 2006
@@ -1585,9 +1585,13 @@
                         int x;
                         uint64_t num = ebml_read_length (s, &x);
                         l = x + num;
+                        free(data);
                         data = malloc (num);
                         if (stream_read(s, data, num) != (int) num)
+                        {
+                          free(data);
                           return 0;
+                        }
                         data_size = num;
                         mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] |  + FileData, length "
                                 "%u\n", data_size);



More information about the MPlayer-cvslog mailing list