# HG changeset patch # User reimar # Date 1169909685 0 # Node ID 9562199ac0756a910ae3f4366063c4c647be7ec2 # Parent 04b7b7090eeefab1852412a695f89d8f209e340c Simplify and make lzo decompression code more similar to zlib one. diff -r 04b7b7090eee -r 9562199ac075 libmpdemux/demux_mkv.c --- 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; }