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

reimar subversion at mplayerhq.hu
Sat Jan 27 15:54:45 CET 2007


Author: reimar
Date: Sat Jan 27 15:54:45 2007
New Revision: 22029

Modified:
   trunk/libmpdemux/demux_mkv.c

Log:
Simplify and make lzo decompression code more similar to zlib one.


Modified: trunk/libmpdemux/demux_mkv.c
==============================================================================
--- trunk/libmpdemux/demux_mkv.c	(original)
+++ trunk/libmpdemux/demux_mkv.c	Sat Jan 27 15:54:45 2007
@@ -637,9 +637,10 @@
               return modified;
             }
 
-          *dest = malloc (dstlen);
+          *dest = NULL;
           while (1)
             {
+              *dest = realloc (*dest, dstlen);
               result = lzo1x_decompress_safe (src, *size, *dest, &dstlen,
                                               NULL);
               if (result == LZO_E_OK)
@@ -655,7 +656,6 @@
               mp_msg (MSGT_DEMUX, MSGL_DBG2,
                       "[mkv] lzo decompression buffer too small.\n");
               dstlen *= 2;
-              *dest = realloc (*dest, dstlen);
             }
           *size = dstlen;
         }



More information about the MPlayer-cvslog mailing list