aboutsummaryrefslogtreecommitdiff
path: root/engines/gob/minigames/geisha/penetration.cpp
diff options
context:
space:
mode:
authorSven Hesse2012-06-03 18:58:03 +0200
committerSven Hesse2012-06-03 18:58:03 +0200
commitdb99d23717ce4f39f9d9f55ce1abf0d8b73cc630 (patch)
tree746f29b071287058a50cd0fd0452e7f45a623705 /engines/gob/minigames/geisha/penetration.cpp
parentd124b87649c14e1851228821fcb6d3a523f1e0ae (diff)
downloadscummvm-rg350-db99d23717ce4f39f9d9f55ce1abf0d8b73cc630.tar.gz
scummvm-rg350-db99d23717ce4f39f9d9f55ce1abf0d8b73cc630.tar.bz2
scummvm-rg350-db99d23717ce4f39f9d9f55ce1abf0d8b73cc630.zip
GOB: Fix invalid reads in Geisha's minigames
Diffstat (limited to 'engines/gob/minigames/geisha/penetration.cpp')
-rw-r--r--engines/gob/minigames/geisha/penetration.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/engines/gob/minigames/geisha/penetration.cpp b/engines/gob/minigames/geisha/penetration.cpp
index e4e7798216..35802e6733 100644
--- a/engines/gob/minigames/geisha/penetration.cpp
+++ b/engines/gob/minigames/geisha/penetration.cpp
@@ -298,6 +298,8 @@ void Penetration::deinit() {
_objects = 0;
_sprites = 0;
+
+ _sub = 0;
}
void Penetration::createMap() {
@@ -503,14 +505,14 @@ void Penetration::checkShields() {
}
void Penetration::updateAnims() {
- int16 left, top, right, bottom;
+ int16 left = 0, top = 0, right = 0, bottom = 0;
// Clear the previous animation frames
for (Common::List<ANIObject *>::iterator a = _anims.reverse_begin();
a != _anims.end(); --a) {
- (*a)->clear(*_vm->_draw->_backSurface, left, top, right, bottom);
- _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
+ if ((*a)->clear(*_vm->_draw->_backSurface, left, top, right, bottom))
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
}
if (_mapUpdate) {
@@ -526,8 +528,8 @@ void Penetration::updateAnims() {
for (Common::List<ANIObject *>::iterator a = _anims.begin();
a != _anims.end(); ++a) {
- (*a)->draw(*_vm->_draw->_backSurface, left, top, right, bottom);
- _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
+ if ((*a)->draw(*_vm->_draw->_backSurface, left, top, right, bottom))
+ _vm->_draw->dirtiedRect(_vm->_draw->_backSurface, left, top, right, bottom);
(*a)->advance();
}