[MPlayer-cvslog] r32358 - in branches/1.0rc4: . libmpdemux/demux_mkv.c

siretart subversion at mplayerhq.hu
Sun Sep 26 11:45:55 CEST 2010


Author: siretart
Date: Sun Sep 26 11:45:55 2010
New Revision: 32358

Log:
Check for realloc failure. Ignore the memleak this causes since
the mkv demuxer is not properly maintained anymore anyway.

r32309 by reimar

Modified:
   branches/1.0rc4/   (props changed)
   branches/1.0rc4/libmpdemux/demux_mkv.c

Modified: branches/1.0rc4/libmpdemux/demux_mkv.c
==============================================================================
--- branches/1.0rc4/libmpdemux/demux_mkv.c	Sun Sep 26 11:34:50 2010	(r32357)
+++ branches/1.0rc4/libmpdemux/demux_mkv.c	Sun Sep 26 11:45:55 2010	(r32358)
@@ -329,6 +329,8 @@ static int demux_mkv_decode(mkv_track_t 
 
                 *size += 4000;
                 *dest = realloc(*dest, *size);
+                if (!*dest)
+                    goto zlib_fail;
                 zstream.next_out = (Bytef *) (*dest + zstream.total_out);
                 result = inflate(&zstream, Z_NO_FLUSH);
                 if (result != Z_OK && result != Z_STREAM_END) {
@@ -358,6 +360,8 @@ zlib_fail:
                 if (dstlen > SIZE_MAX - AV_LZO_OUTPUT_PADDING)
                     goto lzo_fail;
                 *dest = realloc(*dest, dstlen + AV_LZO_OUTPUT_PADDING);
+                if (!*dest)
+                    goto lzo_fail;
                 result = av_lzo1x_decode(*dest, &dstlen, src, &srclen);
                 if (result == 0)
                     break;


More information about the MPlayer-cvslog mailing list