aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorathrxx2018-11-08 01:34:46 +0100
committerathrxx2018-11-08 16:50:31 +0100
commit502280f26d0a6d49fd49bf45f90635d7194cd755 (patch)
treeacb6816d93b3025a07b8a00f6d10bdac426ab583 /engines
parenta37e38830496f4a414bd671428aedbe8831652ff (diff)
downloadscummvm-rg350-502280f26d0a6d49fd49bf45f90635d7194cd755.tar.gz
scummvm-rg350-502280f26d0a6d49fd49bf45f90635d7194cd755.tar.bz2
scummvm-rg350-502280f26d0a6d49fd49bf45f90635d7194cd755.zip
KYRA: (EOB) - fix possible null pointer deref
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/items_eob.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/kyra/items_eob.cpp b/engines/kyra/items_eob.cpp
index c9c632f60b..e2d4b1be56 100644
--- a/engines/kyra/items_eob.cpp
+++ b/engines/kyra/items_eob.cpp
@@ -643,7 +643,8 @@ void EoBCoreEngine::explodeObject(EoBFlyingObject *fo, int block, Item item) {
int b = _expObjectTlMode ? _expObjectTlMode[tl] : 2;
- if (b == 0 || (b == 1 && (fo->direction & 1) == (_currentDirection & 1))) {
+ uint8 fdr = fo ? fo->direction : 0;
+ if (b == 0 || (b == 1 && (fdr & 1) == (_currentDirection & 1))) {
snd_processEnvironmentalSoundEffect(35, _currentBlock);
return;
}