summaryrefslogtreecommitdiff
path: root/src/demuxers
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers')
-rw-r--r--src/demuxers/demux_film.c2
-rw-r--r--src/demuxers/demux_flac.c4
-rw-r--r--src/demuxers/demux_flv.c2
-rw-r--r--src/demuxers/demux_mpgaudio.c2
-rw-r--r--src/demuxers/demux_qt.c3
-rw-r--r--src/demuxers/demux_real.c4
-rw-r--r--src/demuxers/demux_tta.c2
-rw-r--r--src/demuxers/demux_wc3movie.c8
8 files changed, 12 insertions, 15 deletions
diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c
index d3cedc0e1..69c3eea60 100644
--- a/src/demuxers/demux_film.c
+++ b/src/demuxers/demux_film.c
@@ -258,7 +258,7 @@ static int open_film_file(demux_film_t *film) {
film->frequency = BE_32(&film_header[i + 8]);
film->sample_count = BE_32(&film_header[i + 12]);
film->sample_table =
- xine_xmalloc(film->sample_count * sizeof(film_sample_t));
+ xine_xcalloc(film->sample_count, sizeof(film_sample_t));
for (j = 0; j < film->sample_count; j++) {
film->sample_table[j].sample_offset =
diff --git a/src/demuxers/demux_flac.c b/src/demuxers/demux_flac.c
index f52da4d03..116409d1f 100644
--- a/src/demuxers/demux_flac.c
+++ b/src/demuxers/demux_flac.c
@@ -179,8 +179,8 @@ static int open_flac_file(demux_flac_t *flac) {
case 3:
lprintf ("SEEKTABLE metadata, %d bytes\n", block_length);
flac->seekpoint_count = block_length / FLAC_SEEKPOINT_SIZE;
- flac->seekpoints = xine_xmalloc(flac->seekpoint_count *
- sizeof(flac_seekpoint_t));
+ flac->seekpoints = xine_xcalloc(flac->seekpoint_count,
+ sizeof(flac_seekpoint_t));
for (i = 0; i < flac->seekpoint_count; i++) {
if (flac->input->read(flac->input, buffer, FLAC_SEEKPOINT_SIZE) != FLAC_SEEKPOINT_SIZE)
return 0;
diff --git a/src/demuxers/demux_flv.c b/src/demuxers/demux_flv.c
index 0588b408e..5de878b4d 100644
--- a/src/demuxers/demux_flv.c
+++ b/src/demuxers/demux_flv.c
@@ -278,7 +278,7 @@ static int parse_flv_var(demux_flv_t *this,
if (key && keylen == 5 && !strncmp(key, "times", 5)) {
if (this->index)
free (this->index);
- this->index = xine_xmalloc(num*sizeof(flv_index_entry_t));
+ this->index = xine_xcalloc(num, sizeof(flv_index_entry_t));
this->num_indices = num;
for (num = 0; num < this->num_indices && tmp < end; num++) {
if (*tmp++ == FLV_DATA_TYPE_NUMBER) {
diff --git a/src/demuxers/demux_mpgaudio.c b/src/demuxers/demux_mpgaudio.c
index 31b2d33ff..bd55c9f0a 100644
--- a/src/demuxers/demux_mpgaudio.c
+++ b/src/demuxers/demux_mpgaudio.c
@@ -413,7 +413,7 @@ static vbri_header_t* parse_vbri_header(mpg_audio_frame_t *frame,
lprintf("entry_frames: %d\n", vbri->entry_frames);
if ((ptr + (vbri->toc_entries + 1) * vbri->entry_size) >= (buf + bufsize)) return 0;
- vbri->toc = xine_xmalloc (sizeof(int) * (vbri->toc_entries + 1));
+ vbri->toc = xine_xcalloc ((vbri->toc_entries + 1), sizeof(int));
if (!vbri->toc) {
free (vbri);
return NULL;
diff --git a/src/demuxers/demux_qt.c b/src/demuxers/demux_qt.c
index f837a2272..aa2ad8955 100644
--- a/src/demuxers/demux_qt.c
+++ b/src/demuxers/demux_qt.c
@@ -929,12 +929,11 @@ static qt_error parse_trak_atom (qt_trak *trak,
/* allocate space for each of the properties unions */
trak->stsd_atoms_count = BE_32(&trak_atom[i + 8]);
- trak->stsd_atoms = xine_xmalloc(trak->stsd_atoms_count * sizeof(properties_t));
+ trak->stsd_atoms = xine_xcalloc(trak->stsd_atoms_count, sizeof(properties_t));
if (!trak->stsd_atoms) {
last_error = QT_NO_MEMORY;
goto free_trak;
}
- memset(trak->stsd_atoms, 0, trak->stsd_atoms_count * sizeof(properties_t));
atom_pos = i + 0x10;
properties_offset = 0x0C;
diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c
index 11b0dbf38..f0488bc47 100644
--- a/src/demuxers/demux_real.c
+++ b/src/demuxers/demux_real.c
@@ -692,7 +692,7 @@ unknown:
this->video_stream->mdpr->avg_bit_rate);
/* Allocate fragment offset table */
- this->fragment_tab = xine_xmalloc(FRAGMENT_TAB_SIZE*sizeof(uint32_t));
+ this->fragment_tab = xine_xcalloc(FRAGMENT_TAB_SIZE, sizeof(uint32_t));
this->fragment_tab_max = FRAGMENT_TAB_SIZE;
}
@@ -1282,7 +1282,7 @@ static int demux_real_send_chunk(demux_plugin_t *this_gen) {
frames = (stream_read_word(this) & 0xf0) >> 4;
/* 2 bytes per frame size */
- sizes = xine_xmalloc(frames*sizeof(int));
+ sizes = xine_xcalloc(frames, sizeof(int));
for(i = 0; i < frames; i++)
sizes[i] = stream_read_word(this);
diff --git a/src/demuxers/demux_tta.c b/src/demuxers/demux_tta.c
index 81b9c6ede..724404a5b 100644
--- a/src/demuxers/demux_tta.c
+++ b/src/demuxers/demux_tta.c
@@ -87,7 +87,7 @@ static int open_tta_file(demux_tta_t *this) {
return 0;
}
- this->seektable = xine_xmalloc(sizeof(uint32_t)*this->totalframes);
+ this->seektable = xine_xcalloc(this->totalframes, sizeof(uint32_t));
this->input->read(this->input, this->seektable, sizeof(uint32_t)*this->totalframes);
/* Skip the CRC32 */
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) !=