changeset 4253:b0c979816d67 SDL-1.2

Improved bug #759 Don't crash if creating the X image failed.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 27 Sep 2009 22:29:13 +0000
parents 052dc40d917f
children 8afecb86be35
files src/video/x11/SDL_x11video.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/video/x11/SDL_x11video.c	Sun Sep 27 21:44:55 2009 +0000
+++ b/src/video/x11/SDL_x11video.c	Sun Sep 27 22:29:13 2009 +0000
@@ -1196,7 +1196,10 @@
 		current->w = width;
 		current->h = height;
 		current->pitch = SDL_CalculatePitch(current);
-		X11_ResizeImage(this, current, flags);
+		if (X11_ResizeImage(this, current, flags) < 0) {
+			current = NULL;
+			goto done;
+		}
 	}
 
 	/* Clear these flags and set them only if they are in the new set. */