From e48637415285b7d1197ef48c1910635e464de965 Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Sun, 15 Mar 2009 13:28:20 +0000 Subject: Fix crash regression in the Amiga BRA demo, by checking if mask buffer exists, before using it. svn-id: r39418 --- engines/parallaction/gfxbase.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'engines/parallaction/gfxbase.cpp') diff --git a/engines/parallaction/gfxbase.cpp b/engines/parallaction/gfxbase.cpp index a0becfe70e..47bf0000db 100644 --- a/engines/parallaction/gfxbase.cpp +++ b/engines/parallaction/gfxbase.cpp @@ -349,8 +349,12 @@ void Gfx::bltMaskScale(const Common::Rect& r, byte *data, Graphics::Surface *sur } if (*s != transparentColor) { - byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line); - if (z >= v) *d2 = *s; + if (_backgroundInfo->hasMask()) { + byte v = _backgroundInfo->_mask->getValue(dp.x + col, dp.y + line); + if (z >= v) *d2 = *s; + } else { + *d2 = *s; + } } s++; @@ -395,8 +399,12 @@ void Gfx::bltMaskNoScale(const Common::Rect& r, byte *data, Graphics::Surface *s for (uint16 j = 0; j < q.width(); j++) { if (*s != transparentColor) { - byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i); - if (z >= v) *d = *s; + if (_backgroundInfo->hasMask()) { + byte v = _backgroundInfo->_mask->getValue(dp.x + j, dp.y + i); + if (z >= v) *d = *s; + } else { + *d = *s; + } } s++; -- cgit v1.2.3