summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_mng.c4
-rw-r--r--src/demuxers/demux_mod.c6
-rw-r--r--src/demuxers/demux_real.c9
3 files changed, 17 insertions, 2 deletions
diff --git a/src/demuxers/demux_mng.c b/src/demuxers/demux_mng.c
index a32374048..0fcdb24ff 100644
--- a/src/demuxers/demux_mng.c
+++ b/src/demuxers/demux_mng.c
@@ -116,7 +116,9 @@ static mng_bool mymng_process_header(mng_handle mngh, mng_uint32 width, mng_uint
this->bih.biHeight = height;
this->left_edge = (this->bih.biWidth - width) / 2;
- this->image = malloc(this->bih.biWidth * height * 3);
+ this->image = malloc((mng_size_t)this->bih.biWidth * (mng_size_t)height * 3);
+ if (!this->image)
+ return MNG_FALSE;
mng_set_canvasstyle(mngh, MNG_CANVAS_RGB8);
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);
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 27f7a2634..fdb913ef4 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -365,6 +365,10 @@ static void real_parse_audio_specific_data (demux_real_t *this,
stream->frame_num_bytes = 0;
stream->sub_packet_cnt = 0;
+ if (!stream->frame_buffer)
+ xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
+ "demux_real: failed to allocate the audio frame buffer!\n");
+
xprintf (this->stream->xine, XINE_VERBOSITY_LOG,
"demux_real: buf type 0x%08x frame size %zu block align %d\n", stream->buf_type,
stream->frame_size, stream->block_align);
@@ -1373,6 +1377,11 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) {
int x;
off_t pos;
+ if (!buffer) {
+ this->status = DEMUX_FINISHED;
+ return this->status;
+ }
+
switch (this->audio_stream->buf_type) {
case BUF_AUDIO_28_8:
for (x = 0; x < sph / 2; x++) {