music_flac.c
changeset 561 87bdb4c81c0b
parent 545 32e5ed415a34
child 601 05123263dab3
     1.1 --- a/music_flac.c	Fri Jan 13 02:39:41 2012 -0500
     1.2 +++ b/music_flac.c	Fri Jan 13 03:15:19 2012 -0500
     1.3 @@ -187,7 +187,7 @@
     1.4  
     1.5  				// create it
     1.6  				data->flac_data.data =
     1.7 -									(char *)malloc (data->flac_data.data_len);
     1.8 +					(char *)SDL_malloc (data->flac_data.data_len);
     1.9  
    1.10  				if (!data->flac_data.data) {
    1.11  					return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
    1.12 @@ -227,7 +227,7 @@
    1.13  
    1.14  				// make it big enough for the rest of the block
    1.15  				data->flac_data.overflow =
    1.16 -								(char *)malloc (data->flac_data.overflow_len);
    1.17 +					(char *)SDL_malloc (data->flac_data.overflow_len);
    1.18  
    1.19  				if (!data->flac_data.overflow) {
    1.20  					return FLAC__STREAM_DECODER_WRITE_STATUS_ABORT;
    1.21 @@ -313,7 +313,7 @@
    1.22  		return NULL;
    1.23  	}
    1.24  
    1.25 -	music = (FLAC_music *)malloc ( sizeof (*music));
    1.26 +	music = (FLAC_music *)SDL_malloc ( sizeof (*music));
    1.27  	if (music) {
    1.28  		/* Initialize the music structure */
    1.29  		memset (music, 0, (sizeof (*music)));
    1.30 @@ -367,7 +367,7 @@
    1.31  					flac.FLAC__stream_decoder_delete( music->flac_decoder );
    1.32  				case 1:
    1.33  				case 0:
    1.34 -					free(music);
    1.35 +					SDL_free(music);
    1.36  					if (freerw) {
    1.37  						SDL_RWclose(rw);
    1.38  					}
    1.39 @@ -409,7 +409,7 @@
    1.40  	music->flac_data.data_len = music->flac_data.max_to_read;
    1.41  	music->flac_data.data_read = 0;
    1.42  	if (!music->flac_data.data) {
    1.43 -		music->flac_data.data = (char *)malloc (music->flac_data.data_len);
    1.44 +		music->flac_data.data = (char *)SDL_malloc (music->flac_data.data_len);
    1.45  	}
    1.46  
    1.47  	// we have data to read
    1.48 @@ -471,7 +471,7 @@
    1.49  		if (cvt->buf) {
    1.50  			free (cvt->buf);
    1.51  		}
    1.52 -		cvt->buf = (Uint8 *)malloc (music->flac_data.data_len * cvt->len_mult);
    1.53 +		cvt->buf = (Uint8 *)SDL_malloc (music->flac_data.data_len * cvt->len_mult);
    1.54  		music->section = 0;
    1.55  	}
    1.56  	if (cvt->buf) {