From 15f9713a8497662a7bf4003a7bc60f0655bfdefe Mon Sep 17 00:00:00 2001 From: kojima Date: Sun, 4 Jun 2000 02:09:10 +0000 Subject: [PATCH] fixed crash bug when a texture cant be rendered --- src/texture.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/texture.c b/src/texture.c index 21776f3d..63a5ef05 100644 --- a/src/texture.c +++ b/src/texture.c @@ -594,6 +594,10 @@ wTextureRenderImage(WTexture *texture, int width, int height, wwarning(_("could not render texture: %s"), RMessageForError(RErrorCode)); image = RCreateImage(width, height, False); + if (image == NULL) { + wwarning(_("could not allocate image buffer")); + return NULL; + } gray.red = 190; gray.green = 190;