diff options
author | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-03-23 01:51:28 +0000 |
---|---|---|
committer | Darren Salt <linux@youmustbejoking.demon.co.uk> | 2008-03-23 01:51:28 +0000 |
commit | 7a29f15cf90a3629185ef1f3987e24a3910785db (patch) | |
tree | 16241700adba1f9f8820dc0f1ad2cc07845f49a1 /src/demuxers/demux_real.c | |
parent | 9377b41750ebf6e79b3631b4f3c0224ad2cad855 (diff) | |
download | xine-lib-7a29f15cf90a3629185ef1f3987e24a3910785db.tar.gz xine-lib-7a29f15cf90a3629185ef1f3987e24a3910785db.tar.bz2 |
Check for failure of various memory allocations. (SA29484)
Ref. http://aluigi.altervista.org/adv/xinehof-adv.txt
Diffstat (limited to 'src/demuxers/demux_real.c')
-rw-r--r-- | src/demuxers/demux_real.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index 9206bfc74..c5096b210 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -175,7 +175,8 @@ static void real_parse_index(demux_real_t *this) { off_t original_pos = this->input->get_current_pos(this->input); unsigned char index_chunk_header[INDEX_CHUNK_HEADER_SIZE]; unsigned char index_record[INDEX_RECORD_SIZE]; - int i, entries, stream_num; + int i; + unsigned int entries, stream_num; real_index_entry_t **index; while(next_index_chunk) { @@ -230,10 +231,11 @@ static void real_parse_index(demux_real_t *this) { } } - if(index && entries) { + if(index && entries) /* Allocate memory for index */ *index = xine_xmalloc(entries * sizeof(real_index_entry_t)); + if(index && entries && *index) { /* Read index */ for(i = 0; i < entries; i++) { if(this->input->read(this->input, index_record, INDEX_RECORD_SIZE) |