aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-11 15:47:37 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-11 15:47:37 +0000
commitde216f195075f0018b1081427a05c5d1cef54b0d (patch)
tree0070ad1481ac2d69fea6dd5d097935a1e09be018 /libmpdemux
parent155d28bf0189ec21889678b2705c428d1b84d6da (diff)
Avoid memleak on error while reading attachments or multiple
MATROSKA_ID_FILEDATA parts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20160 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_mkv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpdemux/demux_mkv.c b/libmpdemux/demux_mkv.c
index 3619552dbe..ee44b5d202 100644
--- a/libmpdemux/demux_mkv.c
+++ b/libmpdemux/demux_mkv.c
@@ -1585,9 +1585,13 @@ demux_mkv_read_attachments (demuxer_t *demuxer)
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);