diff options
author | Strangerke | 2013-08-21 22:36:14 +0200 |
---|---|---|
committer | Strangerke | 2013-08-21 22:36:14 +0200 |
commit | 5a794448434cb6f42ecd5a71dcc564ff7d296c9b (patch) | |
tree | 7e60e2bc21fb9ced31cc93da826d3789a9c63f5d /engines/mortevielle | |
parent | 6cfd3028c1fdf71238f12e79fba4750e63a92a67 (diff) | |
download | scummvm-rg350-5a794448434cb6f42ecd5a71dcc564ff7d296c9b.tar.gz scummvm-rg350-5a794448434cb6f42ecd5a71dcc564ff7d296c9b.tar.bz2 scummvm-rg350-5a794448434cb6f42ecd5a71dcc564ff7d296c9b.zip |
MORTEVIELLE: Fix CID 1063212
Diffstat (limited to 'engines/mortevielle')
-rw-r--r-- | engines/mortevielle/actions.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/mortevielle/actions.cpp b/engines/mortevielle/actions.cpp index 4de2ebc804..d5b3bd2606 100644 --- a/engines/mortevielle/actions.cpp +++ b/engines/mortevielle/actions.cpp @@ -1008,8 +1008,16 @@ void MortevielleEngine::fctSelfPut() { _crep = 997; else { int i; - for (i = 1; (i <= 6) && (_num != _openObjects[i]); i++) - ; + for (i = 1; i <= 6; i++) { + if (_num == _openObjects[i]) + break; + } + + if (i > 6) { + warning("Unexpected action: Too many open objects"); + return; + } + if (_num == _openObjects[i]) { _curSearchObjId = objId; _crep = 999; |