src/video/SDL_video.c
changeset 944 cdea7cbc3e23
parent 916 46916168361d
child 989 475166d13b44
--- a/src/video/SDL_video.c	Sat Aug 21 12:38:50 2004 +0000
+++ b/src/video/SDL_video.c	Sat Aug 21 13:10:58 2004 +0000
@@ -1275,10 +1275,16 @@
 			/* Lazy physical palette allocation */
 			int size;
 			SDL_Palette *pp = malloc(sizeof(*pp));
+			if ( !pp ) {
+				return 0;
+			}
 			current_video->physpal = pp;
 			pp->ncolors = pal->ncolors;
 			size = pp->ncolors * sizeof(SDL_Color);
 			pp->colors = malloc(size);
+			if ( !pp->colors ) {
+				return 0;
+			}
 			memcpy(pp->colors, pal->colors, size);
 		}
 		if ( ! SetPalette_physical(screen,