summaryrefslogtreecommitdiff
path: root/src/input
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-04-14 18:30:19 +0200
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-04-14 18:30:19 +0200
commite0565eaa178fc0ad4eabcbc48c50085f95bb56a8 (patch)
tree2538a0670c63086213af10fcc8f56532ce7a5792 /src/input
parentdc36f8d045cf4f723c44766f44c92e1810e37f4f (diff)
downloadxine-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/input')
-rw-r--r--src/input/input_cdda.c2
-rw-r--r--src/input/input_dvd.c2
-rw-r--r--src/input/input_file.c6
-rw-r--r--src/input/input_smb.c4
-rw-r--r--src/input/libreal/real.c2
5 files changed, 8 insertions, 8 deletions
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index 8bb35effd..fe4c7f932 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -2450,7 +2450,7 @@ static int cdda_plugin_open (input_plugin_t *this_gen ) {
if(this->cddb.num_tracks) {
int t;
- this->cddb.track = (trackinfo_t *) xine_xmalloc(sizeof(trackinfo_t) * this->cddb.num_tracks);
+ this->cddb.track = (trackinfo_t *) xine_xcalloc(this->cddb.num_tracks, sizeof(trackinfo_t));
for(t = 0; t < this->cddb.num_tracks; t++) {
int length = (toc->toc_entries[t].first_frame_minute * CD_SECONDS_PER_MINUTE +
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index ac09e934b..1a8861289 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -1629,7 +1629,7 @@ static input_plugin_t *dvd_class_get_instance (input_class_t *class_gen, xine_st
this->mem_stack = 0;
this->mem_stack_max = 1024;
- this->mem = xine_xmalloc(sizeof(unsigned char *) * this->mem_stack_max);
+ this->mem = xine_xcalloc(this->mem_stack_max, sizeof(unsigned char *));
if (!this->mem) {
free(this);
return NULL;
diff --git a/src/input/input_file.c b/src/input/input_file.c
index fd2b0e733..0ec25e1f8 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -723,9 +723,9 @@ static xine_mrl_t **file_class_get_dir (input_class_t *this_gen,
return NULL;
}
- dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- hide_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ hide_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
while((pdirent = readdir(pdir)) != NULL) {
diff --git a/src/input/input_smb.c b/src/input/input_smb.c
index 1b1f15565..4cacebf89 100644
--- a/src/input/input_smb.c
+++ b/src/input/input_smb.c
@@ -258,8 +258,8 @@ static xine_mrl_t **smb_class_get_dir (input_class_t *this_gen,
}
if ((dir = smbc_opendir(current_path_smb)) >= 0){
- xine_mrl_t *dir_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
- xine_mrl_t *norm_files = (xine_mrl_t *) xine_xmalloc(sizeof(xine_mrl_t) * MAXFILES);
+ xine_mrl_t *dir_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
+ xine_mrl_t *norm_files = (xine_mrl_t *) xine_xcalloc(MAXFILES, sizeof(xine_mrl_t));
int num_dir_files=0;
int num_norm_files=0;
while ((pdirent = smbc_readdir(dir)) != NULL){
diff --git a/src/input/libreal/real.c b/src/input/libreal/real.c
index dc0c001bd..da7c0c443 100644
--- a/src/input/libreal/real.c
+++ b/src/input/libreal/real.c
@@ -461,7 +461,7 @@ rmff_header_t *real_parse_sdp(char *data, char **stream_rules, uint32_t bandwidt
desc->copyright,
desc->abstract);
header->data=rmff_new_dataheader(0,0);
- header->streams = xine_xmalloc(sizeof(rmff_mdpr_t*)*(desc->stream_count+1));
+ header->streams = xine_xcalloc((desc->stream_count+1), sizeof(rmff_mdpr_t*));
lprintf("number of streams: %u\n", desc->stream_count);
for (i=0; i<desc->stream_count; i++) {