From e0565eaa178fc0ad4eabcbc48c50085f95bb56a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20=27Flameeyes=27=20Petten=C3=B2?= Date: Sat, 14 Apr 2007 18:30:19 +0200 Subject: Use xine_xcalloc instead of xine_xmalloc when mutiplying the number of elements by the size of the single element. --- src/demuxers/demux_wc3movie.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/demuxers/demux_wc3movie.c') 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) != -- cgit v1.2.3