Index: bmp.cpp =================================================================== --- bmp.cpp (revision 22589) +++ bmp.cpp (working copy) @@ -322,6 +322,10 @@ info->compression = ReadDword(buffer); header_size -= 4; } + else + { + info->compression = 0; + } /* Only 4-bit and 8-bit rle compression is supported */ if (info->compression > 2 || (info->compression > 0 && !(info->bpp == 4 || info->bpp == 8))) return false; @@ -335,6 +339,10 @@ info->palette_size = ReadDword(buffer); // number of colours in palette SkipBytes(buffer, header_size - 16); // skip the end of info header } + else + { + info->palette_size = 0; + } if (info->palette_size == 0) info->palette_size = 1 << info->bpp; data->palette = CallocT(info->palette_size); @@ -346,6 +354,10 @@ if (!info->os2_bmp) SkipBytes(buffer, 1); // unused } } + else + { + info->palette_size = 0; + } return buffer->real_pos <= info->offset; }