Skip to content

Commit

Permalink
DIRECTOR: Fix DIB file reading
Browse files Browse the repository at this point in the history
  • Loading branch information
sev- committed Aug 3, 2016
1 parent 1a3d44e commit 9ed9a60
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions engines/director/dib.cpp
Expand Up @@ -95,7 +95,7 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) {
uint32 height = stream.readUint32LE();
stream.readUint16LE(); // planes
uint16 bitsPerPixel = stream.readUint16LE();
uint32 compression = stream.readUint32LE();
uint32 compression = stream.readUint32BE();
uint32 imageSize = stream.readUint32LE();
/* uint32 pixelsPerMeterX = */ stream.readUint32LE();
/* uint32 pixelsPerMeterY = */ stream.readUint32LE();
Expand All @@ -105,7 +105,7 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) {
_paletteColorCount = (_paletteColorCount == 0) ? 255: _paletteColorCount;

uint16 imageRawSize = stream.size() - 40;
Common::SeekableSubReadStream subStream(&stream, 40, imageRawSize);
Common::SeekableSubReadStream subStream(&stream, 40, stream.size());

warning("w: %d h: %d bpp: %d pal: %d size: %d (size rep: %d) comp: %x", width, height, bitsPerPixel, _paletteColorCount, imageRawSize, imageSize, compression);

Expand Down

0 comments on commit 9ed9a60

Please sign in to comment.