src/video/ps2gs/SDL_gsyuv.c
changeset 1336 3692456e7b0f
parent 1312 c9b51268668f
child 1338 604d73db6802
     1.1 --- a/src/video/ps2gs/SDL_gsyuv.c	Mon Feb 06 17:28:04 2006 +0000
     1.2 +++ b/src/video/ps2gs/SDL_gsyuv.c	Tue Feb 07 06:59:48 2006 +0000
     1.3 @@ -114,12 +114,12 @@
     1.4  	}
     1.5  
     1.6  	/* Create the overlay structure */
     1.7 -	overlay = (SDL_Overlay *)malloc(sizeof *overlay);
     1.8 +	overlay = (SDL_Overlay *)SDL_malloc(sizeof *overlay);
     1.9  	if ( overlay == NULL ) {
    1.10  		SDL_OutOfMemory();
    1.11  		return(NULL);
    1.12  	}
    1.13 -	memset(overlay, 0, (sizeof *overlay));
    1.14 +	SDL_memset(overlay, 0, (sizeof *overlay));
    1.15  
    1.16  	/* Fill in the basic members */
    1.17  	overlay->format = format;
    1.18 @@ -131,7 +131,7 @@
    1.19  	overlay->hw_overlay = 1;
    1.20  
    1.21  	/* Create the pixel data */
    1.22 -	hwdata = (struct private_yuvhwdata *)malloc(sizeof *hwdata);
    1.23 +	hwdata = (struct private_yuvhwdata *)SDL_malloc(sizeof *hwdata);
    1.24  	overlay->hwdata = hwdata;
    1.25  	if ( hwdata == NULL ) {
    1.26  		SDL_FreeYUVOverlay(overlay);
    1.27 @@ -139,7 +139,7 @@
    1.28  		return(NULL);
    1.29  	}
    1.30  	hwdata->ipu_fd = -1;
    1.31 -	hwdata->pixels = (Uint8 *)malloc(width*height*2);
    1.32 +	hwdata->pixels = (Uint8 *)SDL_malloc(width*height*2);
    1.33  	if ( hwdata->pixels == NULL ) {
    1.34  		SDL_FreeYUVOverlay(overlay);
    1.35  		SDL_OutOfMemory();
    1.36 @@ -202,7 +202,7 @@
    1.37  
    1.38  	/* Allocate memory for the DMA packets */
    1.39  	hwdata->plist.num = hwdata->macroblocks * 4 + 1;
    1.40 -	hwdata->plist.packet = (struct ps2_packet *)malloc(
    1.41 +	hwdata->plist.packet = (struct ps2_packet *)SDL_malloc(
    1.42  	                       hwdata->plist.num*sizeof(struct ps2_packet));
    1.43  	if ( ! hwdata->plist.packet ) {
    1.44  		SDL_FreeYUVOverlay(overlay);
    1.45 @@ -453,11 +453,11 @@
    1.46  			munmap(hwdata->dma_mem, hwdata->dma_len);
    1.47  		}
    1.48  		if ( hwdata->plist.packet ) {
    1.49 -			free(hwdata->plist.packet);
    1.50 +			SDL_free(hwdata->plist.packet);
    1.51  		}
    1.52  		if ( hwdata->pixels ) {
    1.53 -			free(hwdata->pixels);
    1.54 +			SDL_free(hwdata->pixels);
    1.55  		}
    1.56 -		free(hwdata);
    1.57 +		SDL_free(hwdata);
    1.58  	}
    1.59  }