@@ -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);
Status change: