diff options
author | Filippos Karapetis | 2011-02-02 21:18:10 +0000 |
---|---|---|
committer | Filippos Karapetis | 2011-02-02 21:18:10 +0000 |
commit | 2f08dcb667a0c577d6c18552e0aa896b2ce4e89b (patch) | |
tree | e09b68b0f29f94329bb43120b5cf3006fda4d740 | |
parent | 426354953618135c0cffd6e9f34caf606066e363 (diff) | |
download | scummvm-rg350-2f08dcb667a0c577d6c18552e0aa896b2ce4e89b.tar.gz scummvm-rg350-2f08dcb667a0c577d6c18552e0aa896b2ce4e89b.tar.bz2 scummvm-rg350-2f08dcb667a0c577d6c18552e0aa896b2ce4e89b.zip |
GRAPHICS: Fixed a bug with indexed PNGs in the PNG decoder (a byte can't hold 256 entries)
svn-id: r55742
-rw-r--r-- | graphics/png.cpp | 2 | ||||
-rw-r--r-- | graphics/png.h | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/graphics/png.cpp b/graphics/png.cpp index d0fe64bf25..5292ea0100 100644 --- a/graphics/png.cpp +++ b/graphics/png.cpp @@ -441,7 +441,7 @@ byte PNG::getNumColorChannels() { } void PNG::readPaletteChunk() { - for (byte i = 0; i < _paletteEntries; i++) { + for (uint16 i = 0; i < _paletteEntries; i++) { _palette[i * 4 + 0] = _stream->readByte(); // R _palette[i * 4 + 1] = _stream->readByte(); // G _palette[i * 4 + 2] = _stream->readByte(); // B diff --git a/graphics/png.h b/graphics/png.h index 6b695b5beb..b2ba7ac0f2 100644 --- a/graphics/png.h +++ b/graphics/png.h @@ -145,7 +145,7 @@ private: PNGHeader _header; byte _palette[256 * 4]; // RGBA - byte _paletteEntries; + uint16 _paletteEntries; uint16 _transparentColor[3]; bool _transparentColorSpecified; |