music_ogg.c
changeset 561 87bdb4c81c0b
parent 545 32e5ed415a34
child 601 05123263dab3
child 869 318285c30cff
     1.1 --- a/music_ogg.c	Fri Jan 13 02:39:41 2012 -0500
     1.2 +++ b/music_ogg.c	Fri Jan 13 03:15:19 2012 -0500
     1.3 @@ -84,7 +84,7 @@
     1.4  	callbacks.seek_func = sdl_seek_func;
     1.5  	callbacks.tell_func = sdl_tell_func;
     1.6  
     1.7 -	music = (OGG_music *)malloc(sizeof *music);
     1.8 +	music = (OGG_music *)SDL_malloc(sizeof *music);
     1.9  	if ( music ) {
    1.10  		/* Initialize the music structure */
    1.11  		memset(music, 0, (sizeof *music));
    1.12 @@ -95,7 +95,7 @@
    1.13  		music->section = -1;
    1.14  
    1.15  		if ( vorbis.ov_open_callbacks(rw, &music->vf, NULL, 0, callbacks) < 0 ) {
    1.16 -			free(music);
    1.17 +			SDL_free(music);
    1.18  			if ( freerw ) {
    1.19  				SDL_RWclose(rw);
    1.20  			}
    1.21 @@ -151,9 +151,9 @@
    1.22  		SDL_BuildAudioCVT(cvt, AUDIO_S16, vi->channels, vi->rate,
    1.23  		                       mixer.format,mixer.channels,mixer.freq);
    1.24  		if ( cvt->buf ) {
    1.25 -			free(cvt->buf);
    1.26 +			SDL_free(cvt->buf);
    1.27  		}
    1.28 -		cvt->buf = (Uint8 *)malloc(sizeof(data)*cvt->len_mult);
    1.29 +		cvt->buf = (Uint8 *)SDL_malloc(sizeof(data)*cvt->len_mult);
    1.30  		music->section = section;
    1.31  	}
    1.32  	if ( cvt->buf ) {
    1.33 @@ -211,13 +211,13 @@
    1.34  {
    1.35  	if ( music ) {
    1.36  		if ( music->cvt.buf ) {
    1.37 -			free(music->cvt.buf);
    1.38 +			SDL_free(music->cvt.buf);
    1.39  		}
    1.40  		if ( music->freerw ) {
    1.41  			SDL_RWclose(music->rw);
    1.42  		}
    1.43  		vorbis.ov_clear(&music->vf);
    1.44 -		free(music);
    1.45 +		SDL_free(music);
    1.46  	}
    1.47  }
    1.48