changeset 22011:9562199ac075

Simplify and make lzo decompression code more similar to zlib one.
author reimar
date Sat, 27 Jan 2007 14:54:45 +0000
parents 04b7b7090eee
children 213b5c14bba7
files libmpdemux/demux_mkv.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c	Sat Jan 27 14:52:18 2007 +0000
+++ b/libmpdemux/demux_mkv.c	Sat Jan 27 14:54:45 2007 +0000
@@ -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;
         }