src/video/SDL_video.c
changeset 944 cdea7cbc3e23
parent 916 46916168361d
child 989 475166d13b44
     1.1 --- a/src/video/SDL_video.c	Sat Aug 21 12:38:50 2004 +0000
     1.2 +++ b/src/video/SDL_video.c	Sat Aug 21 13:10:58 2004 +0000
     1.3 @@ -1275,10 +1275,16 @@
     1.4  			/* Lazy physical palette allocation */
     1.5  			int size;
     1.6  			SDL_Palette *pp = malloc(sizeof(*pp));
     1.7 +			if ( !pp ) {
     1.8 +				return 0;
     1.9 +			}
    1.10  			current_video->physpal = pp;
    1.11  			pp->ncolors = pal->ncolors;
    1.12  			size = pp->ncolors * sizeof(SDL_Color);
    1.13  			pp->colors = malloc(size);
    1.14 +			if ( !pp->colors ) {
    1.15 +				return 0;
    1.16 +			}
    1.17  			memcpy(pp->colors, pal->colors, size);
    1.18  		}
    1.19  		if ( ! SetPalette_physical(screen,