mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-05 10:26:40 +00:00
SCI: kStrAt / dont do call, when offset exceeds maxSize. fixes crash in kq5
svn-id: r45530
This commit is contained in:
parent
4009f6836b
commit
0c2ab71829
@ -309,8 +309,11 @@ reg_t kStrAt(EngineState *s, int argc, reg_t *argv) {
|
||||
newvalue = argv[2].toSint16();
|
||||
|
||||
if (dest_r.isRaw) {
|
||||
// FIXME: in kq5 this here gets called with offset = 0xFFFF, we should implement maxSize check in here
|
||||
// i dont know the exact behaviour, so i dont know how to do this correctly
|
||||
// in kq5 this here gets called with offset 0xFFFF
|
||||
if ((int)offset > dest_r.maxSize) {
|
||||
warning("kStrAt offset %X exceeds maxSize", offset);
|
||||
return s->r_acc;
|
||||
}
|
||||
value = dest_r.raw[offset];
|
||||
if (argc > 2) /* Request to modify this char */
|
||||
dest_r.raw[offset] = newvalue;
|
||||
|
Loading…
x
Reference in New Issue
Block a user