DIRECTOR: Add sanity check to BITDDecoder

This commit is contained in:
Eugene Sandulenko 2019-12-31 17:06:03 +01:00
parent 42dc7451ad
commit 7989d65b26

View File

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