From 974a1dd501cf1c2db0cb647d9a0ef8010e52b7fe Mon Sep 17 00:00:00 2001 From: Matthias Hopf Date: Wed, 31 Dec 2008 20:47:08 +0100 Subject: abort if buffer for matroska block data cannot be allocated return error when the allocation function returns NULL Otherwise xine might be induced to segfault by bad user data. --- src/demuxers/demux_matroska.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/demuxers/demux_matroska.c b/src/demuxers/demux_matroska.c index 12cd282dd..924c70bde 100644 --- a/src/demuxers/demux_matroska.c +++ b/src/demuxers/demux_matroska.c @@ -1823,6 +1823,11 @@ static int read_block_data (demux_matroska_t *this, size_t len) { alloc_block_data(this, len); /* block datas */ + if (! this->block_data) { + xprintf(this->stream->xine, XINE_VERBOSITY_LOG, + "demux_matroska: memory allocation error\n"); + return 0; + } if (this->input->read(this->input, this->block_data, len) != len) { off_t pos = this->input->get_current_pos(this->input); xprintf(this->stream->xine, XINE_VERBOSITY_LOG, -- cgit v1.2.3