summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2011-06-15 18:53:58 +0000
committerfrosch <frosch@openttd.org>2011-06-15 18:53:58 +0000
commit5f29da4ee005e8c838d0f52e51025228a389c33b (patch)
tree5ef01f5424311b967004d983301e04e0183a33cf
parent4d7a413edabc62ea0808b36a9570bf7d5c42abd8 (diff)
downloadopenttd-5f29da4ee005e8c838d0f52e51025228a389c33b.tar.xz
(svn r22592) -Fix [FS#4645]: Reading of heightmaps with uncommon BMP formats failed due to uninitialised variables. (Parody)
-rw-r--r--src/bmp.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/bmp.cpp b/src/bmp.cpp
index 64b3f14ea..2c85c768b 100644
--- a/src/bmp.cpp
+++ b/src/bmp.cpp
@@ -13,6 +13,7 @@
#include "bmp.h"
#include "core/bitmath_func.hpp"
#include "core/alloc_func.hpp"
+#include "core/mem_func.hpp"
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
{
@@ -287,6 +288,7 @@ bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data)
{
uint32 header_size;
assert(info != NULL);
+ MemSetT(info, 0);
/* Reading BMP header */
if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM'