diff options
author | Max Horn | 2004-02-18 10:42:26 +0000 |
---|---|---|
committer | Max Horn | 2004-02-18 10:42:26 +0000 |
commit | 3e58cb906a0a467f75cab2c5c202e5ec87993d5b (patch) | |
tree | 1f235c6fa3abfd7ceed58de046a47fe44948e91e /scumm | |
parent | a092b1536ab1d0a7da6e1dbb90bf1eacdfe70fe9 (diff) | |
download | scummvm-rg350-3e58cb906a0a467f75cab2c5c202e5ec87993d5b.tar.gz scummvm-rg350-3e58cb906a0a467f75cab2c5c202e5ec87993d5b.tar.bz2 scummvm-rg350-3e58cb906a0a467f75cab2c5c202e5ec87993d5b.zip |
Add some safety checks
svn-id: r12928
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/script_v6.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index 797a689977..0403b05664 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -2706,6 +2706,8 @@ void ScummEngine_v6::o6_kernelGetFunctions() { if (args[1] != -1 && args[2] != -1) { VirtScreen *vs = &virtscr[0]; + assert(0 <= args[1] && args[1] < vs->width); + assert(0 <= args[2] && args[2] < vs->height); push(vs->screenPtr[args[1] + args[2] * vs->width]); } else push(0); @@ -3080,6 +3082,8 @@ void ScummEngine_v6::o6_unknownE1() { return; } + // FIXME: Actually, there is only one virtscr in V7/V8 games anyway. + // And topline is always 0 for it. VirtScreen *vs = findVirtScreen(y); if (vs == NULL) { |