mirror of https://github.com/OpenTTD/OpenTTD
(svn r22592) -Fix [FS#4645]: Reading of heightmaps with uncommon BMP formats failed due to uninitialised variables. (Parody)
parent
4d7a413eda
commit
5f29da4ee0
|
@ -13,6 +13,7 @@
|
||||||
#include "bmp.h"
|
#include "bmp.h"
|
||||||
#include "core/bitmath_func.hpp"
|
#include "core/bitmath_func.hpp"
|
||||||
#include "core/alloc_func.hpp"
|
#include "core/alloc_func.hpp"
|
||||||
|
#include "core/mem_func.hpp"
|
||||||
|
|
||||||
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
|
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
|
||||||
{
|
{
|
||||||
|
@ -287,6 +288,7 @@ bool BmpReadHeader(BmpBuffer *buffer, BmpInfo *info, BmpData *data)
|
||||||
{
|
{
|
||||||
uint32 header_size;
|
uint32 header_size;
|
||||||
assert(info != NULL);
|
assert(info != NULL);
|
||||||
|
MemSetT(info, 0);
|
||||||
|
|
||||||
/* Reading BMP header */
|
/* Reading BMP header */
|
||||||
if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM'
|
if (ReadWord(buffer) != 0x4D42) return false; // signature should be 'BM'
|
||||||
|
|
Loading…
Reference in New Issue