From b9dc65ff35387961d9526f5c443f9af43a3c1909 Mon Sep 17 00:00:00 2001 From: Darren Salt Date: Wed, 13 Aug 2008 17:33:04 +0100 Subject: Check for allocation failures. --- src/demuxers/demux_mod.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/demuxers/demux_mod.c') diff --git a/src/demuxers/demux_mod.c b/src/demuxers/demux_mod.c index 9bb17a990..bffcf36d8 100644 --- a/src/demuxers/demux_mod.c +++ b/src/demuxers/demux_mod.c @@ -134,7 +134,11 @@ static int open_mod_file(demux_mod_t *this) { /* Get size and create buffer */ this->filesize = this->input->get_length(this->input); this->buffer = (char *)malloc(this->filesize); - + if(!this->buffer) { + xine_log(this->stream->xine, XINE_LOG_PLUGIN, "modplug - allocation failure\n"); + return 0; + } + /* Seek to beginning */ this->input->seek(this->input, 0, SEEK_SET); -- cgit v1.2.3