diff options
-rw-r--r-- | src/combined/ffmpeg/ff_audio_decoder.c | 8 | ||||
-rw-r--r-- | src/demuxers/demux_4xm.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_avi.c | 9 | ||||
-rw-r--r-- | src/demuxers/demux_film.c | 8 | ||||
-rw-r--r-- | src/demuxers/demux_iff.c | 6 | ||||
-rw-r--r-- | src/demuxers/demux_real.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_realaudio.c | 2 | ||||
-rw-r--r-- | src/demuxers/demux_wav.c | 2 | ||||
-rw-r--r-- | src/libmusepack/xine_musepack_decoder.c | 2 | ||||
-rw-r--r-- | src/libreal/xine_real_audio_decoder.c | 6 | ||||
-rw-r--r-- | src/libxineadec/nsf.c | 2 | ||||
-rw-r--r-- | src/libxinevdec/bitplane.c | 20 | ||||
-rw-r--r-- | src/libxinevdec/rgb.c | 2 | ||||
-rw-r--r-- | src/video_out/video_out_opengl.c | 3 | ||||
-rw-r--r-- | src/xine-engine/alphablend.c | 8 | ||||
-rw-r--r-- | src/xine-engine/input_cache.c | 2 | ||||
-rw-r--r-- | src/xine-engine/xine.c | 4 | ||||
-rw-r--r-- | src/xine-utils/xmllexer.c | 3 |
18 files changed, 39 insertions, 52 deletions
diff --git a/src/combined/ffmpeg/ff_audio_decoder.c b/src/combined/ffmpeg/ff_audio_decoder.c index de45cc1a2..4d8e440bb 100644 --- a/src/combined/ffmpeg/ff_audio_decoder.c +++ b/src/combined/ffmpeg/ff_audio_decoder.c @@ -249,8 +249,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) break; /* abort early - extradata length is bad */ this->context->extradata_size = data_len; - this->context->extradata = xine_xmalloc(this->context->extradata_size + - FF_INPUT_BUFFER_PADDING_SIZE); + this->context->extradata = malloc(this->context->extradata_size + + FF_INPUT_BUFFER_PADDING_SIZE); xine_fast_memcpy (this->context->extradata, this->buf + extradata, this->context->extradata_size); break; @@ -284,8 +284,8 @@ static void ff_audio_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) (buf->decoder_info[1] == BUF_SPECIAL_STSD_ATOM)) { this->context->extradata_size = buf->decoder_info[2]; - this->context->extradata = xine_xmalloc(buf->decoder_info[2] + - FF_INPUT_BUFFER_PADDING_SIZE); + this->context->extradata = malloc(buf->decoder_info[2] + + FF_INPUT_BUFFER_PADDING_SIZE); memcpy(this->context->extradata, buf->decoder_info_ptr[2], buf->decoder_info[2]); diff --git a/src/demuxers/demux_4xm.c b/src/demuxers/demux_4xm.c index a5fcd6568..c264e4421 100644 --- a/src/demuxers/demux_4xm.c +++ b/src/demuxers/demux_4xm.c @@ -158,7 +158,7 @@ static int open_fourxm_file(demux_fourxm_t *fourxm) { /* read the whole header */ header_size = _X_LE_32(&preview[4]) - 4; - header = xine_xmalloc(header_size); + header = malloc(header_size); if (!header || fourxm->input->read(fourxm->input, header, header_size) != header_size) { free(header); return 0; diff --git a/src/demuxers/demux_avi.c b/src/demuxers/demux_avi.c index 6a942c4df..37f74ddb1 100644 --- a/src/demuxers/demux_avi.c +++ b/src/demuxers/demux_avi.c @@ -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); @@ -921,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; diff --git a/src/demuxers/demux_film.c b/src/demuxers/demux_film.c index 7abbf7134..27986d9e1 100644 --- a/src/demuxers/demux_film.c +++ b/src/demuxers/demux_film.c @@ -151,7 +151,7 @@ static int open_film_file(demux_film_t *film) { /* header size = header size - 16-byte FILM signature */ film_header_size = _X_BE_32(&scratch[4]) - 16; - film_header = xine_xmalloc(film_header_size); + film_header = malloc(film_header_size); if (!film_header) return 0; strncpy(film->version, &scratch[8], 4); @@ -331,10 +331,8 @@ static int open_film_file(demux_film_t *film) { /* allocate enough space in the interleave preload buffer for the * first chunk (which will be more than enough for successive chunks) */ if (film->audio_type) { - if (film->interleave_buffer) - free(film->interleave_buffer); - film->interleave_buffer = - xine_xmalloc(film->sample_table[0].sample_size); + free(film->interleave_buffer); + film->interleave_buffer = calloc(1, film->sample_table[0].sample_size); if (!film->interleave_buffer) goto film_abort; } diff --git a/src/demuxers/demux_iff.c b/src/demuxers/demux_iff.c index d43eebf22..1785e86d7 100644 --- a/src/demuxers/demux_iff.c +++ b/src/demuxers/demux_iff.c @@ -399,7 +399,7 @@ static int read_iff_chunk(demux_iff_t *this) { case IFF_CMAP_CHUNK: /* every color contains red, green and blue componente using 8Bit */ this->cmap_num = junk_size / PIC_SIZE_OF_COLOR_REGISTER; - this->cmap = (ColorRegister *)xine_xmalloc(junk_size); + this->cmap = (ColorRegister *)malloc(junk_size); this->video_send_palette = 1; if (!this->cmap || this->input->read(this->input, (char *)this->cmap, junk_size) != junk_size) return 0; @@ -711,14 +711,14 @@ static int demux_iff_send_chunk(demux_plugin_t *this_gen) { if (this->audio_interleave_buffer_size > 0) { this->audio_interleave_buffer = - xine_xmalloc(this->audio_interleave_buffer_size); + calloc(1, this->audio_interleave_buffer_size); if (!this->audio_interleave_buffer) return this->status = DEMUX_FINISHED; } if (this->audio_read_buffer_size > 0) { this->audio_read_buffer = - xine_xmalloc(this->audio_read_buffer_size); + calloc(1, this->audio_read_buffer_size); if (!this->audio_read_buffer) return this->status = DEMUX_FINISHED; } diff --git a/src/demuxers/demux_real.c b/src/demuxers/demux_real.c index ad5daf5ea..48bf24969 100644 --- a/src/demuxers/demux_real.c +++ b/src/demuxers/demux_real.c @@ -440,7 +440,7 @@ static void real_parse_headers (demux_real_t *this) { case CONT_TAG: chunk_size -= PREAMBLE_SIZE; - chunk_buffer = xine_xmalloc(chunk_size); + chunk_buffer = malloc(chunk_size); if (this->input->read(this->input, chunk_buffer, chunk_size) != chunk_size) { free (chunk_buffer); diff --git a/src/demuxers/demux_realaudio.c b/src/demuxers/demux_realaudio.c index e34fe0857..bc132adae 100644 --- a/src/demuxers/demux_realaudio.c +++ b/src/demuxers/demux_realaudio.c @@ -110,7 +110,7 @@ static int open_ra_file(demux_ra_t *this) { } /* allocate for and read header data */ - this->header = xine_xmalloc(this->header_size); + this->header = malloc(this->header_size); if (!this->header || _x_demux_read_header(this->input, this->header, this->header_size) != this->header_size) { xprintf(this->stream->xine, XINE_VERBOSITY_DEBUG, "demux_realaudio: unable to read header\n"); diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index b8d3a8229..4a1cc78ec 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -126,7 +126,7 @@ static int open_wav_file(demux_wav_t *this) { return 0; this->input->seek(this->input, wave_pos, SEEK_SET); - this->wave = xine_xmalloc( this->wave_size ); + this->wave = malloc( this->wave_size ); if (!this->wave || this->input->read(this->input, (void *)this->wave, this->wave_size) != this->wave_size) { diff --git a/src/libmusepack/xine_musepack_decoder.c b/src/libmusepack/xine_musepack_decoder.c index 39d17f574..115532e86 100644 --- a/src/libmusepack/xine_musepack_decoder.c +++ b/src/libmusepack/xine_musepack_decoder.c @@ -214,7 +214,7 @@ static void mpc_decode_data (audio_decoder_t *this_gen, buf_element_t *buf) { this->file_size = buf->decoder_info[0]; /* Initialise the data accumulation buffer */ - this->buf = xine_xmalloc(INIT_BUFSIZE); + this->buf = calloc(1, INIT_BUFSIZE); this->buf_max = INIT_BUFSIZE; this->read = 0; this->size = 0; diff --git a/src/libreal/xine_real_audio_decoder.c b/src/libreal/xine_real_audio_decoder.c index 296077b6d..7f4942cc5 100644 --- a/src/libreal/xine_real_audio_decoder.c +++ b/src/libreal/xine_real_audio_decoder.c @@ -310,14 +310,14 @@ static int init_codec (realdec_decoder_t *this, buf_element_t *buf) { if (this->sps) { this->frame_size = this->w/this->sps*this->h*this->sps; - this->frame_buffer = xine_xmalloc (this->frame_size); - this->frame_reordered = xine_xmalloc (this->frame_size); + this->frame_buffer = calloc (1, this->frame_size); + this->frame_reordered = calloc (1, this->frame_size); this->frame_num_bytes = 0; } else { this->frame_size = this->w*this->h; - this->frame_buffer = xine_xmalloc (this->frame_size); + this->frame_buffer = calloc (this->w, this->h); this->frame_reordered = this->frame_buffer; this->frame_num_bytes = 0; diff --git a/src/libxineadec/nsf.c b/src/libxineadec/nsf.c index 4b476d036..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 */ diff --git a/src/libxinevdec/bitplane.c b/src/libxinevdec/bitplane.c index 5cee51764..057511c29 100644 --- a/src/libxinevdec/bitplane.c +++ b/src/libxinevdec/bitplane.c @@ -252,7 +252,7 @@ static uint8_t *bitplane_decode_byterun1 (uint8_t *compressed, int i = 0; int j = 0; - uint8_t *uncompressed = xine_xmalloc( size_uncompressed ); + uint8_t *uncompressed = calloc(1, size_uncompressed ); while ( i < size_compressed && pixel_ptr < size_uncompressed ) { @@ -1189,7 +1189,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen, if (this->buf) free (this->buf); this->bufsize = VIDEOBUFSIZE; - this->buf = xine_xmalloc(this->bufsize); + this->buf = calloc(1, this->bufsize); this->size = 0; this->framenumber = 0; @@ -1255,7 +1255,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen, case BUF_VIDEO_BITPLANE: /* uncompressed Buffer, set decoded_buf pointer direct to input stream */ if( this->buf_uk == NULL ) - this->buf_uk = xine_xmalloc( (this->size) ); + this->buf_uk = malloc(this->size); xine_fast_memcpy (this->buf_uk, this->buf, this->size); break; case BUF_VIDEO_BITPLANE_BR1: @@ -1294,7 +1294,7 @@ static void bitplane_decode_data (video_decoder_t *this_gen, } } if( this->buf_uk_hist == NULL ) { - this->buf_uk_hist = xine_xmalloc( (this->size_uk) ); + this->buf_uk_hist = malloc(this->size_uk); xine_fast_memcpy (this->buf_uk_hist, this->buf_uk, this->size_uk); xine_fast_memcpy (this->index_buf_hist, this->index_buf, (this->num_pixel * this->bytes_per_pixel)); @@ -1306,20 +1306,12 @@ static void bitplane_decode_data (video_decoder_t *this_gen, /* when no start-picture is given, create a empty one */ if( this->buf_uk_hist == NULL ) { this->size_uk = (((this->num_pixel) / 8) * this->num_bitplanes); - this->buf_uk = xine_xmalloc( (this->size_uk) ); - this->buf_uk_hist = xine_xmalloc( (this->size_uk) ); - for (i = 0; i < this->size_uk; i++) { - this->buf_uk[i] = 0; - this->buf_uk_hist[i] = 0; - } + this->buf_uk = calloc(this->num_bitplanes, ((this->num_pixel) / 8)); + this->buf_uk_hist = calloc(this->num_bitplanes, ((this->num_pixel) / 8)); } if( this->index_buf == NULL ) { this->index_buf = calloc( this->num_pixel, this->bytes_per_pixel ); this->index_buf_hist = calloc( this->num_pixel, this->bytes_per_pixel ); - for (i = 0; i < (this->num_pixel * this->bytes_per_pixel); i++) { - this->index_buf[i] = 0; - this->index_buf_hist[i] = 0; - } } switch( anhd->operation ) { diff --git a/src/libxinevdec/rgb.c b/src/libxinevdec/rgb.c index a94e4b4a1..c1e7f398b 100644 --- a/src/libxinevdec/rgb.c +++ b/src/libxinevdec/rgb.c @@ -145,7 +145,7 @@ static void rgb_decode_data (video_decoder_t *this_gen, /* minimal buffer size */ this->bufsize = this->width * this->height * this->bytes_per_pixel; - this->buf = xine_xmalloc(this->bufsize); + this->buf = calloc(1, this->bufsize); this->size = 0; init_yuv_planes(&this->yuv_planes, this->width, this->height); diff --git a/src/video_out/video_out_opengl.c b/src/video_out/video_out_opengl.c index 46fffabf8..9dcfd4f2e 100644 --- a/src/video_out/video_out_opengl.c +++ b/src/video_out/video_out_opengl.c @@ -1875,8 +1875,7 @@ static vo_driver_t *opengl_open_plugin (video_driver_class_t *class_gen, const v this->drawable, X11OSD_SHAPED); XUnlockDisplay (this->display); - render_fun_names = xine_xmalloc ((sizeof(opengl_rb)/sizeof(opengl_render_t)+1) - * sizeof (const char *)); + render_fun_names = calloc((sizeof(opengl_rb)/sizeof(opengl_render_t)+1), sizeof(const char*)); for (i = 0; i < sizeof (opengl_rb) / sizeof (opengl_render_t); i++) render_fun_names[i] = opengl_rb[i].name; render_fun_names[i] = NULL; diff --git a/src/xine-engine/alphablend.c b/src/xine-engine/alphablend.c index a7ab33cf8..6f3ac3ebe 100644 --- a/src/xine-engine/alphablend.c +++ b/src/xine-engine/alphablend.c @@ -1110,12 +1110,12 @@ static uint8_t *(*blend_yuv_grow_extra_data(alphablend_t *extra_data, int osd_wi uint8_t *data[ 3 ][ 2 ]; } *header = (struct header_s *)extra_data->buffer; - int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]); + size_t needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ][ 2 ]); if (extra_data->buffer_size < needed_buffer_size) { free(extra_data->buffer); - header = xine_xmalloc(needed_buffer_size); + header = calloc(1, needed_buffer_size); if (!header) { extra_data->buffer_size = 0; return 0; @@ -1552,12 +1552,12 @@ static uint8_t *(*blend_yuy2_grow_extra_data(alphablend_t *extra_data, int osd_w uint8_t *data[ 3 ]; } *header = (struct header_s *)extra_data->buffer; - int needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ]); + size_t needed_buffer_size = sizeof (*header) + osd_width * sizeof (uint8_t[ 3 ]); if (extra_data->buffer_size < needed_buffer_size) { free(extra_data->buffer); - header = xine_xmalloc(needed_buffer_size); + header = calloc(1, needed_buffer_size); if (!header) { extra_data->buffer_size = 0; return 0; diff --git a/src/xine-engine/input_cache.c b/src/xine-engine/input_cache.c index 242449b9f..4eb524af6 100644 --- a/src/xine-engine/input_cache.c +++ b/src/xine-engine/input_cache.c @@ -386,7 +386,7 @@ input_plugin_t *_x_cache_plugin_get_instance (xine_stream_t *stream, int readahe this->buf_size = DEFAULT_BUFFER_SIZE; } - this->buf = (char *)xine_xmalloc(this->buf_size); + this->buf = calloc(1, this->buf_size); if (!this->buf) { free (this); return NULL; diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c index 92f7a2603..fd10a7401 100644 --- a/src/xine-engine/xine.c +++ b/src/xine-engine/xine.c @@ -1938,7 +1938,7 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he uint8_t **img, int *size, int alloc_img) { vo_frame_t *frame; - int required_size; + size_t required_size; stream->xine->port_ticket->acquire(stream->xine->port_ticket, 0); frame = stream->video_out->get_last_frame (stream->video_out); @@ -1993,7 +1993,7 @@ static int _x_get_current_frame_impl (xine_stream_t *stream, int *width, int *he if (size) *size = required_size; /* allocate img or fail */ - if (!(*img = xine_xmalloc (required_size))) + if (!(*img = calloc(1, required_size))) return 0; } else { /* fail if supplied buffer is to small */ diff --git a/src/xine-utils/xmllexer.c b/src/xine-utils/xmllexer.c index 09e5a5e24..7da4cc59b 100644 --- a/src/xine-utils/xmllexer.c +++ b/src/xine-utils/xmllexer.c @@ -29,7 +29,6 @@ #include "xineutils.h" #else #define lprintf(...) -#define xine_xmalloc malloc #endif #include "xmllexer.h" #include <stdio.h> @@ -534,7 +533,7 @@ static struct { char *lexer_decode_entities (const char *tok) { - char *buf = xine_xmalloc (strlen (tok) + 1); + char *buf = calloc (strlen (tok) + 1, sizeof(char)); char *bp = buf; char c; |