summaryrefslogtreecommitdiffstats
path: root/libmpdemux/demux_mkv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmpdemux/demux_mkv.c')
-rw-r--r--libmpdemux/demux_mkv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index 3b06e73cde..977261e29e 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -637,9 +637,10 @@ demux_mkv_decode (mkv_track_t *track, uint8_t *src, uint8_t **dest,
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 @@ demux_mkv_decode (mkv_track_t *track, uint8_t *src, uint8_t **dest,
mp_msg (MSGT_DEMUX, MSGL_DBG2,
"[mkv] lzo decompression buffer too small.\n");
dstlen *= 2;
- *dest = realloc (*dest, dstlen);
}
*size = dstlen;
}