diff options
author | Eugene Sandulenko | 2019-12-31 17:06:03 +0100 |
---|---|---|
committer | Eugene Sandulenko | 2019-12-31 17:06:03 +0100 |
commit | 7989d65b26fa0788db05c8a9f49d7be4cab80722 (patch) | |
tree | 87d91096798fd83d9338a13134223f68d855bce0 /engines/director | |
parent | 42dc7451adb979229588784a22560b92342b4d59 (diff) | |
download | scummvm-rg350-7989d65b26fa0788db05c8a9f49d7be4cab80722.tar.gz scummvm-rg350-7989d65b26fa0788db05c8a9f49d7be4cab80722.tar.bz2 scummvm-rg350-7989d65b26fa0788db05c8a9f49d7be4cab80722.zip |
DIRECTOR: Add sanity check to BITDDecoder
Diffstat (limited to 'engines/director')
-rw-r--r-- | engines/director/images.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/engines/director/images.cpp b/engines/director/images.cpp index 3d031c7518..10d73accc1 100644 --- a/engines/director/images.cpp +++ b/engines/director/images.cpp @@ -107,6 +107,12 @@ bool DIBDecoder::loadStream(Common::SeekableReadStream &stream) { BITDDecoder::BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch) { _surface = new Graphics::Surface(); + if (pitch < w) { + warning("BITDDecoder: pitch is too small: %d < %d", pitch, w); + + pitch = w; + } + Graphics::PixelFormat pf = Graphics::PixelFormat::createFormatCLUT8(); switch (bitsPerPixel) { case 2: |