aboutsummaryrefslogtreecommitdiffhomepage
path: root/demux
diff options
context:
space:
mode:
authorGravatar wm4 <wm4@nowhere>2017-11-10 12:49:53 +0100
committerGravatar wm4 <wm4@nowhere>2017-11-10 12:49:53 +0100
commit618b8a33e5ed0acbe59ec62ab11f9aabf76ef0cd (patch)
treea255af1196211a737dae15821bb957f53288f739 /demux
parent6bcdcaeeeabf3845bb69cadfb281089d434cb306 (diff)
demux_mkv: fix potential uninitialized variable read
Diffstat (limited to 'demux')
-rw-r--r--demux/demux_mkv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/demux/demux_mkv.c b/demux/demux_mkv.c
index 5f3ec6d514..600ecdf5a6 100644
--- a/demux/demux_mkv.c
+++ b/demux/demux_mkv.c
@@ -2494,13 +2494,14 @@ static int read_block(demuxer_t *demuxer, int64_t end, struct block_info *block)
uint64_t num;
int16_t time;
uint64_t length;
- int res = -1;
free_block(block);
length = ebml_read_length(s);
if (!length || length > 500000000 || stream_tell(s) + length > (uint64_t)end)
- goto exit;
+ return -1;
+
uint64_t endpos = stream_tell(s) + length;
+ int res = -1;
// Parse header of the Block element
/* first byte(s): track num */