diff options
author | whiterandrek | 2018-06-09 22:20:01 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 30b5c30ab238270835c8673bf7c91e8f0b3e6403 (patch) | |
tree | 6ebd24a1fe955d7f92fd6bdb003fd709961f58fc /engines | |
parent | cf04fb20c76f4c0ce52939e074cb79c40367f93a (diff) | |
download | scummvm-rg350-30b5c30ab238270835c8673bf7c91e8f0b3e6403.tar.gz scummvm-rg350-30b5c30ab238270835c8673bf7c91e8f0b3e6403.tar.bz2 scummvm-rg350-30b5c30ab238270835c8673bf7c91e8f0b3e6403.zip |
PINK: fix accessing non-existent pixels
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pink/director.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/engines/pink/director.cpp b/engines/pink/director.cpp index dd8e870b8d..12088003f5 100644 --- a/engines/pink/director.cpp +++ b/engines/pink/director.cpp @@ -114,9 +114,10 @@ Actor *Director::getActorByPoint(const Common::Point point) { CelDecoder *decoder = _sprites[i]->getDecoder(); const Graphics::Surface *frame = decoder->getCurrentFrame(); const Common::Rect &rect = decoder->getRectangle(); - byte spritePixel = *(const byte*) frame->getBasePtr(point.x - rect.left, point.y - rect.top); - if (rect.contains(point) && spritePixel != decoder->getTransparentColourIndex()) { - return _sprites[i]->getActor(); + if (rect.contains(point)) { + byte spritePixel = *(const byte*) frame->getBasePtr(point.x - rect.left, point.y - rect.top); + if (spritePixel != decoder->getTransparentColourIndex()) + return _sprites[i]->getActor(); } } |