From da6e1b31ea969797810b45fd160a5e88b18ecc90 Mon Sep 17 00:00:00 2001 From: ehofman Date: Thu, 13 Jan 2005 18:05:46 +0000 Subject: [PATCH] Fix a crash situation. --- simgear/screen/texture.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/simgear/screen/texture.cxx b/simgear/screen/texture.cxx index dba9449f..f2062d9e 100644 --- a/simgear/screen/texture.cxx +++ b/simgear/screen/texture.cxx @@ -533,6 +533,7 @@ SGTexture::ImageOpen(const char *fileName) } image = new SGTexture::ImageRec; + memset(image, 0, sizeof(SGTexture::ImageRec)); if (image == 0) { errstr = OUT_OF_MEMORY; return 0; @@ -602,6 +603,7 @@ SGTexture::RawImageOpen(const char *fileName) } image = new SGTexture::ImageRec; + memset(image, 0, sizeof(SGTexture::ImageRec)); if (image == 0) { errstr = OUT_OF_MEMORY; return 0; @@ -648,6 +650,7 @@ SGTexture::ImageWriteOpen(const char *fileName) } image = new SGTexture::ImageRec; + memset(image, 0, sizeof(SGTexture::ImageRec)); if (image == 0) { errstr = OUT_OF_MEMORY; return 0;