summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglx <glx@openttd.org>2007-01-11 21:49:39 +0000
committerglx <glx@openttd.org>2007-01-11 21:49:39 +0000
commit2533b4a5206d7236fb294e609f31e8ba7a1d8877 (patch)
treef783af20ff3f95bb10c07a1f9fc4c66599786472
parent7885defae59f1dda591fe0631b8fe3f216fc5646 (diff)
downloadopenttd-2533b4a5206d7236fb294e609f31e8ba7a1d8877.tar.xz
(svn r8070) -Fix r5815: missing initialisation could cause crash when loading 24bpp BMP heightmap
-rw-r--r--src/heightmap.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/heightmap.cpp b/src/heightmap.cpp
index adedc06b4..7d1809410 100644
--- a/src/heightmap.cpp
+++ b/src/heightmap.cpp
@@ -226,6 +226,9 @@ static bool ReadHeightmapBMP(char *filename, uint *x, uint *y, byte **map)
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);