1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-18 12:55:16 +00:00

demux_mkv: check block malloc() result

This commit is contained in:
wm4 2013-04-12 17:40:45 +02:00
parent 9f21c81633
commit 6ef855069f

View File

@ -2091,6 +2091,8 @@ static int read_block(demuxer_t *demuxer, struct block_info *block)
if (length > 500000000)
goto exit;
block->alloc = malloc(length + AV_LZO_INPUT_PADDING);
if (!block->alloc)
goto exit;
block->data = (bstr){block->alloc, length};
demuxer->filepos = stream_tell(s);
if (stream_read(s, block->data.start, block->data.len) != block->data.len)