# HG changeset patch # User glx # Date 2007-01-11 21:49:39 # Node ID 43cf51840b92fa84073ef16fe1f1bbec98afe362 # Parent 8d09b743989e6575ddf67e8b8fa1b17968b7eb08 (svn r8070) -Fix r5815: missing initialisation could cause crash when loading 24bpp BMP heightmap diff --git a/src/heightmap.cpp b/src/heightmap.cpp --- a/src/heightmap.cpp +++ b/src/heightmap.cpp @@ -226,6 +226,9 @@ static bool ReadHeightmapBMP(char *filen BmpData data; BmpBuffer buffer; + // Init BmpData + memset(&data, 0, sizeof(data)); + f = fopen(filename, "rb"); if (f == NULL) { ShowErrorMessage(STR_PNGMAP_ERR_FILE_NOT_FOUND, STR_BMPMAP_ERROR, 0, 0);