IMG_pnm.c
changeset 343 5bf0f0d6a74e
parent 320 aa5d55b11751
child 347 ad5034cad524
     1.1 --- a/IMG_pnm.c	Sun Jan 27 15:55:03 2013 -0800
     1.2 +++ b/IMG_pnm.c	Sun Feb 03 08:37:28 2013 -0800
     1.3 @@ -39,7 +39,7 @@
     1.4  /* See if an image is contained in a data source */
     1.5  int IMG_isPNM(SDL_RWops *src)
     1.6  {
     1.7 -	int start;
     1.8 +	Sint64 start;
     1.9  	int is_PNM;
    1.10  	char magic[2];
    1.11  
    1.12 @@ -105,7 +105,7 @@
    1.13  
    1.14  SDL_Surface *IMG_LoadPNM_RW(SDL_RWops *src)
    1.15  {
    1.16 -	int start;
    1.17 +	Sint64 start;
    1.18  	SDL_Surface *surface = NULL;
    1.19  	int width, height;
    1.20  	int maxval, y, bpl;
    1.21 @@ -177,13 +177,13 @@
    1.22  		c[1].r = c[1].g = c[1].b = 0;
    1.23  		surface->format->palette->ncolors = 2;
    1.24  		bpl = (width + 7) >> 3;
    1.25 -		buf = malloc(bpl);
    1.26 +		buf = (Uint8 *)SDL_malloc(bpl);
    1.27  		if(buf == NULL)
    1.28  			ERROR("Out of memory");
    1.29  	}
    1.30  
    1.31  	/* Read the image into the surface */
    1.32 -	row = surface->pixels;
    1.33 +	row = (Uint8 *)surface->pixels;
    1.34  	for(y = 0; y < height; y++) {
    1.35  		if(ascii) {
    1.36  			int i;