summaryrefslogtreecommitdiff
path: root/src/demuxers/demux_avi.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/demuxers/demux_avi.c')
-rw-r--r--src/demuxers/demux_avi.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c
index e06caf94f..0f1735f96 100644
--- a/src/demuxers/demux_avi.c
+++ b/src/demuxers/demux_avi.c
@@ -719,7 +719,7 @@ static void reset_idx(demux_avi_t *this, avi_t *AVI) {
}
}
-static avi_t *AVI_init(demux_avi_t *this) {
+static avi_t *XINE_MALLOC AVI_init(demux_avi_t *this) {
avi_t *AVI;
int i, j, idx_type;
@@ -739,7 +739,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
/* Create avi_t structure */
lprintf("start\n");
- AVI = (avi_t *) xine_xmalloc(sizeof(avi_t));
+ AVI = (avi_t *) calloc(1, sizeof(avi_t));
if(AVI==NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
@@ -790,7 +790,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
if(strncasecmp(data,"hdrl",4) == 0) {
hdrl_len = n;
- hdrl_data = (unsigned char *) xine_xmalloc(n);
+ hdrl_data = (unsigned char *) malloc(n);
if(hdrl_data==0)
ERR_EXIT(AVI_ERR_NO_MEM);
if (this->input->read(this->input, hdrl_data,n) != n )
@@ -812,9 +812,8 @@ static avi_t *AVI_init(demux_avi_t *this) {
break if this is not the case */
AVI->n_idx = AVI->max_idx = n / 16;
- if (AVI->idx)
- free(AVI->idx); /* On the off chance there are multiple index chunks */
- AVI->idx = (unsigned char((*)[16])) xine_xmalloc(n);
+ free(AVI->idx); /* On the off chance there are multiple index chunks */
+ AVI->idx = (unsigned char((*)[16])) malloc(n);
if (AVI->idx == 0)
ERR_EXIT(AVI_ERR_NO_MEM);
@@ -877,12 +876,11 @@ static avi_t *AVI_init(demux_avi_t *this) {
} else if (strncasecmp (hdrl_data+i,"auds",4) ==0 /* && ! auds_strh_seen*/) {
if(AVI->n_audio < MAX_AUDIO_STREAMS) {
- avi_audio_t *a = (avi_audio_t *) xine_xmalloc(sizeof(avi_audio_t));
+ avi_audio_t *a = (avi_audio_t *) calloc(1, sizeof(avi_audio_t));
if(a==NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
}
- memset((void *)a,0,sizeof(avi_audio_t));
AVI->audio[AVI->n_audio] = a;
a->audio_strn = num_stream;
@@ -922,7 +920,7 @@ static avi_t *AVI_init(demux_avi_t *this) {
if(lasttag == 1) {
/* lprintf ("size : %d\n",sizeof(AVI->bih)); */
AVI->bih = (xine_bmiheader *)
- xine_xmalloc((n < sizeof(xine_bmiheader)) ? sizeof(xine_bmiheader) : n);
+ malloc((n < sizeof(xine_bmiheader)) ? sizeof(xine_bmiheader) : n);
if(AVI->bih == NULL) {
this->AVI_errno = AVI_ERR_NO_MEM;
return 0;
@@ -2278,7 +2276,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
return NULL;
}
- this = xine_xmalloc (sizeof (demux_avi_t));
+ this = calloc(1, sizeof(demux_avi_t));
this->stream = stream;
this->input = input;
@@ -2320,7 +2318,7 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen, xine_stream_t *str
static void *init_class (xine_t *xine, void *data) {
demux_avi_class_t *this;
- this = xine_xmalloc (sizeof (demux_avi_class_t));
+ this = calloc(1, sizeof(demux_avi_class_t));
this->demux_class.open_plugin = open_plugin;
this->demux_class.description = N_("AVI/RIFF demux plugin");