GRAPHICS: Fixed a bug with indexed PNGs in the PNG decoder (a byte can't hold 256 entries)

svn-id: r55742
This commit is contained in:
Filippos Karapetis 2011-02-02 21:18:10 +00:00
parent 4263549536
commit 2f08dcb667
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -145,7 +145,7 @@ private:
PNGHeader _header;
byte _palette[256 * 4]; // RGBA
byte _paletteEntries;
uint16 _paletteEntries;
uint16 _transparentColor[3];
bool _transparentColorSpecified;