aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorMatthew Hoops2012-09-17 12:35:17 -0400
committerMatthew Hoops2012-09-17 12:35:17 -0400
commit7759f47607ac9e24295ced6383943692568ec038 (patch)
tree4223ae5d884355bc297eba0d459370d2e237ec94 /graphics
parentc0babb010a7f803e54f3021e9560d77baf69fdb8 (diff)
downloadscummvm-rg350-7759f47607ac9e24295ced6383943692568ec038.tar.gz
scummvm-rg350-7759f47607ac9e24295ced6383943692568ec038.tar.bz2
scummvm-rg350-7759f47607ac9e24295ced6383943692568ec038.zip
GRAPHICS: Fix BMP palette color count with bpp != 8
Diffstat (limited to 'graphics')
-rw-r--r--graphics/decoders/bmp.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/decoders/bmp.cpp b/graphics/decoders/bmp.cpp
index f15d4e2519..0d2165643d 100644
--- a/graphics/decoders/bmp.cpp
+++ b/graphics/decoders/bmp.cpp
@@ -100,10 +100,10 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
_paletteColorCount = stream.readUint32LE();
/* uint32 colorsImportant = */ stream.readUint32LE();
- if (_paletteColorCount == 0)
- _paletteColorCount = 256;
-
if (bitsPerPixel == 8) {
+ if (_paletteColorCount == 0)
+ _paletteColorCount = 256;
+
// Read the palette
_palette = new byte[_paletteColorCount * 3];
for (uint16 i = 0; i < _paletteColorCount; i++) {