diff options
author | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:30:19 +0200 |
---|---|---|
committer | Diego 'Flameeyes' Pettenò <flameeyes@gmail.com> | 2007-04-14 18:30:19 +0200 |
commit | e0565eaa178fc0ad4eabcbc48c50085f95bb56a8 (patch) | |
tree | 2538a0670c63086213af10fcc8f56532ce7a5792 /src/demuxers/demux_wc3movie.c | |
parent | dc36f8d045cf4f723c44766f44c92e1810e37f4f (diff) | |
download | xine-lib-e0565eaa178fc0ad4eabcbc48c50085f95bb56a8.tar.gz xine-lib-e0565eaa178fc0ad4eabcbc48c50085f95bb56a8.tar.bz2 |
Use xine_xcalloc instead of xine_xmalloc when mutiplying the number of elements by the size of the single element.
Diffstat (limited to 'src/demuxers/demux_wc3movie.c')
-rw-r--r-- | src/demuxers/demux_wc3movie.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/demuxers/demux_wc3movie.c b/src/demuxers/demux_wc3movie.c index fa1cfb17d..8645c9189 100644 --- a/src/demuxers/demux_wc3movie.c +++ b/src/demuxers/demux_wc3movie.c @@ -380,17 +380,15 @@ static int open_mve_file(demux_mve_t *this) { this->number_of_shots = LE_32(&preamble[0]); /* allocate space for the shot offset index and set offsets to 0 */ - this->shot_offsets = xine_xmalloc(this->number_of_shots * sizeof(off_t)); + this->shot_offsets = xine_xcalloc(this->number_of_shots, sizeof(off_t)); this->current_shot = 0; - for (i = 0; i < this->number_of_shots; i++) - this->shot_offsets[i] = 0; /* skip the SOND chunk */ this->input->seek(this->input, 12, SEEK_CUR); /* load the palette chunks */ - this->palettes = xine_xmalloc(this->number_of_shots * PALETTE_SIZE * - sizeof(palette_entry_t)); + this->palettes = xine_xcalloc(this->number_of_shots, PALETTE_SIZE * + sizeof(palette_entry_t)); for (i = 0; i < this->number_of_shots; i++) { /* make sure there was a valid palette chunk preamble */ if (this->input->read(this->input, preamble, PREAMBLE_SIZE) != |