Mercurial > mplayer.hg
changeset 20154:2e7baee989ad
Avoid memleak on error while reading attachments or multiple
MATROSKA_ID_FILEDATA parts.
author | reimar |
---|---|
date | Wed, 11 Oct 2006 15:47:37 +0000 |
parents | b9c036c1a7e1 |
children | c903e0d80f02 |
files | libmpdemux/demux_mkv.c |
diffstat | 1 files changed, 4 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libmpdemux/demux_mkv.c Wed Oct 11 15:28:54 2006 +0000 +++ b/libmpdemux/demux_mkv.c Wed Oct 11 15:47:37 2006 +0000 @@ -1585,9 +1585,13 @@ int x; uint64_t num = ebml_read_length (s, &x); l = x + num; + free(data); data = malloc (num); if (stream_read(s, data, num) != (int) num) + { + free(data); return 0; + } data_size = num; mp_msg (MSGT_DEMUX, MSGL_V, "[mkv] | + FileData, length " "%u\n", data_size);