aboutsummaryrefslogtreecommitdiff
path: root/engines/director
diff options
context:
space:
mode:
authorEugene Sandulenko2017-02-09 18:43:30 +0100
committerEugene Sandulenko2017-02-09 18:45:42 +0100
commit5fb528743b1e98fb769686b5193c4e58cf32143f (patch)
tree79f98fd3924b532ef4d8ed965a2cb9132b706113 /engines/director
parentb4ea7e0ce99b8cda65d75374fa29805e2d7fcda7 (diff)
downloadscummvm-rg350-5fb528743b1e98fb769686b5193c4e58cf32143f.tar.gz
scummvm-rg350-5fb528743b1e98fb769686b5193c4e58cf32143f.tar.bz2
scummvm-rg350-5fb528743b1e98fb769686b5193c4e58cf32143f.zip
DIRECTOR: Lingo: Add sanity checks to score-related built-ins
Diffstat (limited to 'engines/director')
-rw-r--r--engines/director/lingo/lingo-funcs.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index 5ae58a9207..6260fe9562 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -171,6 +171,9 @@ void Lingo::func_mciwait(Common::String &s) {
void Lingo::func_goto(Datum &frame, Datum &movie) {
g_director->_playbackPaused = false;
+ if (!_vm->getCurrentScore())
+ return;
+
if (movie.type != VOID) {
movie.toString();
@@ -206,13 +209,15 @@ void Lingo::func_goto(Datum &frame, Datum &movie) {
return;
if (frame.type == STRING) {
- _vm->_currentScore->setStartToLabel(*frame.u.s);
+ if (_vm->getCurrentScore())
+ _vm->getCurrentScore()->setStartToLabel(*frame.u.s);
return;
}
frame.toInt();
- _vm->_currentScore->setCurrentFrame(frame.u.i);
+ if (_vm->getCurrentScore())
+ _vm->getCurrentScore()->setCurrentFrame(frame.u.i);
}
void Lingo::func_gotoloop() {
@@ -273,6 +278,9 @@ void Lingo::func_beep(int repeats) {
}
int Lingo::func_marker(int m) {
+ if (!_vm->getCurrentScore())
+ return 0;
+
int labelNumber = _vm->getCurrentScore()->getCurrentLabelNumber();
if (m != 0) {
if (m < 0) {