summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_mod.c
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2008-08-13 17:33:04 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2008-08-13 17:33:04 +0100
commitb9dc65ff35387961d9526f5c443f9af43a3c1909 (patch)
tree88011028b413e4fb50d50eb2402427401b58ea56 /src/demuxers/demux_mod.c
parent4aef516243988c11ad23ed11c373228598f3e48b (diff)
downloadxine-lib-b9dc65ff35387961d9526f5c443f9af43a3c1909.tar.gz
xine-lib-b9dc65ff35387961d9526f5c443f9af43a3c1909.tar.bz2
Check for allocation failures.
Diffstat (limited to 'src/demuxers/demux_mod.c')
-rw-r--r--src/demuxers/demux_mod.c6
1 files changed, 5 insertions, 1 deletions
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);