diff options
author | Matthias Hopf <mhopf@suse.de> | 2008-12-31 22:56:18 +0100 |
---|---|---|
committer | Matthias Hopf <mhopf@suse.de> | 2008-12-31 22:56:18 +0100 |
commit | 7caa938a4628d487332f4b52c1a571fe8084a9b0 (patch) | |
tree | 35c27aa31954b1883e701335a5c3712fbc788604 | |
parent | 974a1dd501cf1c2db0cb647d9a0ef8010e52b7fe (diff) | |
download | xine-lib-7caa938a4628d487332f4b52c1a571fe8084a9b0.tar.gz xine-lib-7caa938a4628d487332f4b52c1a571fe8084a9b0.tar.bz2 |
check return value of input->read_block for NULL in mpeg demuxing
-rw-r--r-- | src/demuxers/demux_mpeg.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/demuxers/demux_mpeg.c b/src/demuxers/demux_mpeg.c index 4be2bfc50..a9dae3040 100644 --- a/src/demuxers/demux_mpeg.c +++ b/src/demuxers/demux_mpeg.c @@ -279,6 +279,10 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) if((this->dummy_space[0] & 0xE0) == 0x20) { buf = this->input->read_block (this->input, this->video_fifo, len-1); + if (! buf) { + this->status = DEMUX_FINISHED; + return; + } track = (this->dummy_space[0] & 0x1f); @@ -298,6 +302,10 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) int spu_id = this->dummy_space[1] & 0x03; buf = this->input->read_block (this->input, this->video_fifo, len-1); + if (! buf) { + this->status = DEMUX_FINISHED; + return; + } buf->type = BUF_SPU_SVCD + spu_id; buf->pts = pts; @@ -318,6 +326,10 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) if((this->dummy_space[0] & 0xfc) == 0x00) { buf = this->input->read_block (this->input, this->video_fifo, len-1); + if (! buf) { + this->status = DEMUX_FINISHED; + return; + } buf->type = BUF_SPU_CVD + (this->dummy_space[0] & 0x03); buf->pts = pts; @@ -376,6 +388,10 @@ static void parse_mpeg2_packet (demux_mpeg_t *this, int stream_id, int64_t scr) i = this->input->read (this->input, this->dummy_space+1, 6); buf = this->input->read_block (this->input, this->video_fifo, len-7); + if (! buf) { + this->status = DEMUX_FINISHED; + return; + } buf->type = BUF_AUDIO_LPCM_BE + track; buf->decoder_flags |= BUF_FLAG_SPECIAL; |