summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Hopf <mhopf@suse.de>2008-12-31 20:47:08 +0100
committerMatthias Hopf <mhopf@suse.de>2008-12-31 20:47:08 +0100
commit974a1dd501cf1c2db0cb647d9a0ef8010e52b7fe (patch)
tree532cfccd1622fd8b829f7ab414a29c1b4271444e /src
parent60ddd2922aabe6704e0baa135ca54e9111782b7c (diff)
downloadxine-lib-974a1dd501cf1c2db0cb647d9a0ef8010e52b7fe.tar.gz
xine-lib-974a1dd501cf1c2db0cb647d9a0ef8010e52b7fe.tar.bz2
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.
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_matroska.c5
1 files changed, 5 insertions, 0 deletions
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,