[Scummvm-git-logs] scummvm master -> a672b3fe47a138234a363f90cccca84e51621421

dreammaster paulfgilbert at gmail.com
Mon Feb 24 01:51:15 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a672b3fe47 ULTIMA8: Ignore opcode which could cause crash closing backpack


Commit: a672b3fe47a138234a363f90cccca84e51621421
    https://github.com/scummvm/scummvm/commit/a672b3fe47a138234a363f90cccca84e51621421
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-02-23T17:51:11-08:00

Commit Message:
ULTIMA8: Ignore opcode which could cause crash closing backpack

After using the keyring to unlock a chest, occasionally opcode 0x44
references a value higher than the length of the source list. The
simple workaround is to ignore this opcode in this case.  It's not
a proper fix but it prevents a crash and I haven't found any
side-effect of doing it.

Changed paths:
    engines/ultima/ultima8/usecode/uc_machine.cpp


diff --git a/engines/ultima/ultima8/usecode/uc_machine.cpp b/engines/ultima/ultima8/usecode/uc_machine.cpp
index 30bc6e7..2415398 100644
--- a/engines/ultima/ultima8/usecode/uc_machine.cpp
+++ b/engines/ultima/ultima8/usecode/uc_machine.cpp
@@ -1090,10 +1090,15 @@ void UCMachine::execProcess(UCProcess *p) {
 //				error = true;
 			} else {
 				if (ui32b) {
-					uint16 s = getList(ui16b)->getStringIndex(ui16a);
+					uint16 s = l->getStringIndex(ui16a);
 					p->_stack.push2(duplicateString(s));
 				} else {
-					p->_stack.push((*getList(ui16b))[ui16a], ui32a);
+					if (ui16a < l->getSize()) {
+						p->_stack.push((*l)[ui16a], ui32a);
+					} else {
+						perr << "Warning: ignore 0x44 request to push " << ui16a <<
+								" from list len " << l->getSize() << Std::endl;
+					}
 				}
 			}
 			LOGPF(("push element\t%02X slist==%02X\n", ui32a, ui32b));




More information about the Scummvm-git-logs mailing list