summaryrefslogtreecommitdiff
path: root/src/libxineadec
diff options
context:
space:
mode:
Diffstat (limited to 'src/libxineadec')
-rw-r--r--src/libxineadec/fooaudio.c4
-rw-r--r--src/libxineadec/gsm610.c6
-rw-r--r--src/libxineadec/nsf.c6
-rw-r--r--src/libxineadec/xine_lpcm_decoder.c4
-rw-r--r--src/libxineadec/xine_speex_decoder.c10
-rw-r--r--src/libxineadec/xine_vorbis_decoder.c6
6 files changed, 18 insertions, 18 deletions
diff --git a/src/libxineadec/fooaudio.c b/src/libxineadec/fooaudio.c
index 5ab4fa1f6..319eefb0e 100644
--- a/src/libxineadec/fooaudio.c
+++ b/src/libxineadec/fooaudio.c
@@ -91,7 +91,7 @@ static void fooaudio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf)
this->channels = buf->decoder_info[3];
/* initialize the data accumulation buffer */
- this->buf = xine_xmalloc(AUDIOBUFSIZE);
+ this->buf = calloc(1, AUDIOBUFSIZE);
this->bufsize = AUDIOBUFSIZE;
this->size = 0;
@@ -255,7 +255,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
fooaudio_decoder_t *this ;
- this = (fooaudio_decoder_t *) xine_xmalloc (sizeof (fooaudio_decoder_t));
+ this = (fooaudio_decoder_t *) calloc(1, sizeof(fooaudio_decoder_t));
/* connect the member functions */
this->audio_decoder.decode_data = fooaudio_decode_data;
diff --git a/src/libxineadec/gsm610.c b/src/libxineadec/gsm610.c
index 23c0d2104..c67382bc5 100644
--- a/src/libxineadec/gsm610.c
+++ b/src/libxineadec/gsm610.c
@@ -101,7 +101,7 @@ static void gsm610_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
if (buf->decoder_flags & BUF_FLAG_STDHEADER) {
this->sample_rate = buf->decoder_info[1];
- this->buf = xine_xmalloc(AUDIOBUFSIZE);
+ this->buf = calloc(1, AUDIOBUFSIZE);
this->bufsize = AUDIOBUFSIZE;
this->size = 0;
@@ -233,7 +233,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
gsm610_decoder_t *this ;
- this = (gsm610_decoder_t *) xine_xmalloc (sizeof (gsm610_decoder_t));
+ this = (gsm610_decoder_t *) calloc(1, sizeof(gsm610_decoder_t));
this->audio_decoder.decode_data = gsm610_decode_data;
this->audio_decoder.reset = gsm610_reset;
@@ -265,7 +265,7 @@ static void *init_plugin (xine_t *xine, void *data) {
gsm610_class_t *this ;
- this = (gsm610_class_t *) xine_xmalloc (sizeof (gsm610_class_t));
+ this = (gsm610_class_t *) calloc(1, sizeof(gsm610_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/nsf.c b/src/libxineadec/nsf.c
index bdf523f1d..0c9cdbf55 100644
--- a/src/libxineadec/nsf.c
+++ b/src/libxineadec/nsf.c
@@ -90,7 +90,7 @@ static void nsf_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) {
this->song_number = buf->content[4];
/* allocate a buffer for the file */
this->nsf_size = _X_BE_32(&buf->content[0]);
- this->nsf_file = xine_xmalloc(this->nsf_size);
+ this->nsf_file = calloc(1, this->nsf_size);
this->nsf_index = 0;
/* peform any other required initialization */
@@ -205,7 +205,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
nsf_decoder_t *this ;
- this = (nsf_decoder_t *) xine_xmalloc (sizeof (nsf_decoder_t));
+ this = (nsf_decoder_t *) calloc(1, sizeof(nsf_decoder_t));
/* connect the member functions */
this->audio_decoder.decode_data = nsf_decode_data;
@@ -255,7 +255,7 @@ static void *init_plugin (xine_t *xine, void *data) {
nsf_class_t *this ;
- this = (nsf_class_t *) xine_xmalloc (sizeof (nsf_class_t));
+ this = (nsf_class_t *) calloc(1, sizeof(nsf_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_lpcm_decoder.c b/src/libxineadec/xine_lpcm_decoder.c
index eeed7ba35..e1d81a8bb 100644
--- a/src/libxineadec/xine_lpcm_decoder.c
+++ b/src/libxineadec/xine_lpcm_decoder.c
@@ -240,7 +240,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen, xine_stre
lpcm_decoder_t *this ;
- this = (lpcm_decoder_t *) xine_xmalloc (sizeof (lpcm_decoder_t));
+ this = (lpcm_decoder_t *) calloc(1, sizeof(lpcm_decoder_t));
this->audio_decoder.decode_data = lpcm_decode_data;
this->audio_decoder.reset = lpcm_reset;
@@ -275,7 +275,7 @@ static void *init_plugin (xine_t *xine, void *data) {
lpcm_class_t *this ;
- this = (lpcm_class_t *) xine_xmalloc (sizeof (lpcm_class_t));
+ this = (lpcm_class_t *) calloc(1, sizeof(lpcm_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_speex_decoder.c b/src/libxineadec/xine_speex_decoder.c
index dd7f988e2..46ea3a9f9 100644
--- a/src/libxineadec/xine_speex_decoder.c
+++ b/src/libxineadec/xine_speex_decoder.c
@@ -170,16 +170,16 @@ void read_metadata (speex_decoder_t *this, char * comments, int length)
#endif
for (i = 0; speex_comment_keys[i].key != NULL; i++) {
+ size_t keylen = strlen(speex_comment_keys[i].key);
if ( !strncasecmp (speex_comment_keys[i].key, c,
- strlen(speex_comment_keys[i].key)) ) {
- int keylen = strlen(speex_comment_keys[i].key);
+ keylen) ) {
char meta_info[(len - keylen) + 1];
lprintf ("known metadata %d %d\n",
i, speex_comment_keys[i].xine_metainfo_index);
- snprintf(meta_info, (len - keylen), "%s", c + keylen);
+ strncpy(meta_info, &c[keylen], len-keylen);
_x_meta_info_set_utf8(this->stream, speex_comment_keys[i].xine_metainfo_index, meta_info);
}
}
@@ -355,7 +355,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
speex_decoder_t *this ;
static SpeexStereoState init_stereo = SPEEX_STEREO_STATE_INIT;
- this = (speex_decoder_t *) xine_xmalloc (sizeof (speex_decoder_t));
+ this = (speex_decoder_t *) calloc(1, sizeof(speex_decoder_t));
this->audio_decoder.decode_data = speex_decode_data;
this->audio_decoder.reset = speex_reset;
@@ -396,7 +396,7 @@ static void *init_plugin (xine_t *xine, void *data) {
speex_class_t *this;
- this = (speex_class_t *) xine_xmalloc (sizeof (speex_class_t));
+ this = (speex_class_t *) calloc(1, sizeof(speex_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;
diff --git a/src/libxineadec/xine_vorbis_decoder.c b/src/libxineadec/xine_vorbis_decoder.c
index b3acff811..218c26033 100644
--- a/src/libxineadec/xine_vorbis_decoder.c
+++ b/src/libxineadec/xine_vorbis_decoder.c
@@ -315,7 +315,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
vorbis_decoder_t *this ;
- this = (vorbis_decoder_t *) xine_xmalloc (sizeof (vorbis_decoder_t));
+ this = (vorbis_decoder_t *) calloc(1, sizeof(vorbis_decoder_t));
this->audio_decoder.decode_data = vorbis_decode_data;
this->audio_decoder.reset = vorbis_reset;
@@ -328,7 +328,7 @@ static audio_decoder_t *open_plugin (audio_decoder_class_t *class_gen,
this->convsize = 0;
this->bufsize = INIT_BUFSIZE;
- this->buf = xine_xmalloc(INIT_BUFSIZE);
+ this->buf = calloc(1, INIT_BUFSIZE);
this->size = 0;
vorbis_info_init(&this->vi);
@@ -359,7 +359,7 @@ static void *init_plugin (xine_t *xine, void *data) {
vorbis_class_t *this;
- this = (vorbis_class_t *) xine_xmalloc (sizeof (vorbis_class_t));
+ this = (vorbis_class_t *) calloc(1, sizeof(vorbis_class_t));
this->decoder_class.open_plugin = open_plugin;
this->decoder_class.get_identifier = get_identifier;