aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2012-10-23 09:16:15 +1100
committerPaul Gilbert2012-10-23 09:16:15 +1100
commit37dcdbf52767563c79c476315b39b055b7cf088f (patch)
tree4be8e90386436f42af15ed599c226a95f4abdf31 /engines
parent289ca6e50d32d3bfb71f7ba07973622752354017 (diff)
downloadscummvm-rg350-37dcdbf52767563c79c476315b39b055b7cf088f.tar.gz
scummvm-rg350-37dcdbf52767563c79c476315b39b055b7cf088f.tar.bz2
scummvm-rg350-37dcdbf52767563c79c476315b39b055b7cf088f.zip
HOPKINS: Fix decoding error in REPONSE
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/talk.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 608d74b006..0aea2310f4 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -974,10 +974,10 @@ LABEL_2:
v5 = v5 + 1;
if (v15 == 1) {
v6 = v5 + 5;
- ptr = _vm->_globals.dos_malloc2(0x26Cu);
+ ptr = _vm->_globals.dos_malloc2(620);
if (g_PTRNUL == ptr)
error("TRADUC");
- memset(ptr, 0, 0x26Bu);
+ memset(ptr, 0, 620);
v7 = 0;
v12 = 0;
v14 = 0;
@@ -985,9 +985,12 @@ LABEL_2:
v16 = 0;
if (*(v7 + v6) == 'F' && *(v6 + v7 + 1) == 'C') {
++v12;
+ assert(v12 < (620 / 20));
+
v8 = (ptr + 20 * v12);
v11 = 0;
do {
+ assert(v11 < 20);
*(v11++ + v8) = *(v7++ + v6);
if (*(v7 + v6) == 'F' && *(v6 + v7 + 1) == 'F') {
v16 = 1;
@@ -999,7 +1002,7 @@ LABEL_2:
} while (v16 != 1);
}
if (v16 != 1) {
- if (*(v7 + v6) == 'F' && *(v6 + v7 + 1) == 'O' && *(v6 + v7 + 2) == 'D')
+ if (*(v7 + v6) == 'C' && *(v6 + v7 + 1) == 'O' && *(v6 + v7 + 2) == 'D')
v14 = 1;
if (v16 != 1 && *(v7 + v6) == 'F' && *(v6 + v7 + 1) == 'I' && *(v6 + v7 + 2) == 'N')
v14 = 1;