]> git.mxchange.org Git - simgear.git/commitdiff
Fix a crash situation.
authorehofman <ehofman>
Thu, 13 Jan 2005 18:05:46 +0000 (18:05 +0000)
committerehofman <ehofman>
Thu, 13 Jan 2005 18:05:46 +0000 (18:05 +0000)
simgear/screen/texture.cxx

index dba9449f983df703a4c662e4d7a231a643aed835..f2062d9ea75184713a0511e9b9fc25d47478bfd0 100644 (file)
@@ -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;