diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/gc.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/engines/sci/engine/gc.cpp b/engines/sci/engine/gc.cpp index 2d71878bda..9c580dd8dc 100644 --- a/engines/sci/engine/gc.cpp +++ b/engines/sci/engine/gc.cpp @@ -87,7 +87,8 @@ static void processWorkList(SegManager *segMan, WorklistManager &wm, const Commo wm._worklist.pop_back(); if (reg.segment != stackSegment) { // No need to repeat this one debugC(kDebugLevelGC, "[GC] Checking %04x:%04x", PRINT_REG(reg)); - if (reg.segment < heap.size() && heap[reg.segment]) { + // We only check for valid offsets here. Fixes bugs #3299458 and #3295849. + if (reg.segment < heap.size() && heap[reg.segment] && heap[reg.segment]->isValidOffset(reg.offset)) { // Valid heap object? Find its outgoing references! wm.pushArray(heap[reg.segment]->listAllOutgoingReferences(reg)); } |