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_real.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/demuxers/demux_real.c') 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++) { -- cgit v1.2.3