aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
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);