Changeset - r17797:a5bcb68664f7
[Not reviewed]
master
0 1 0
frosch - 13 years ago 2011-06-15 18:53:58
frosch@openttd.org
(svn r22592) -Fix [FS#4645]: Reading of heightmaps with uncommon BMP formats failed due to uninitialised variables. (Parody)
1 file changed with 2 insertions and 0 deletions:
0 comments (0 inline, 0 general)
src/bmp.cpp
Show inline comments
 
@@ -10,12 +10,13 @@
 
/** @file bmp.cpp Read and write support for bmps. */
 

	
 
#include "stdafx.h"
 
#include "bmp.h"
 
#include "core/bitmath_func.hpp"
 
#include "core/alloc_func.hpp"
 
#include "core/mem_func.hpp"
 

	
 
void BmpInitializeBuffer(BmpBuffer *buffer, FILE *file)
 
{
 
	buffer->pos      = -1;
 
	buffer->file     = file;
 
	buffer->read     = 0;
 
@@ -284,12 +285,13 @@ static inline bool BmpRead24(BmpBuffer *
 
 * Reads bitmap headers, and palette (if any)
 
 */
 
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'
 
	SkipBytes(buffer, 8); // skip file size and reserved
 
	info->offset = ReadDword(buffer);
 

	
0 comments (0 inline, 0 general)