Ticket #9168: crash_on_bad_node_lookup.patch

File crash_on_bad_node_lookup.patch, 822 bytes (added by SF/david-kaplan, 14 years ago)
  • engines/sci/graphics/animate.cpp

     
    9797                        // Call .doit method of that object
    9898                        invoke_selector(_s, curObject, g_sci->getKernel()->_selectorCache.doit, kContinueOnInvalidSelector, argc, argv, 0);
    9999                        // Lookup node again, since the nodetable it was in may have been reallocated
    100                         curNode = _s->_segMan->lookupNode(curAddress);
     100                        // BUT only if there is in fact a new node [this fixes crash on arrival on island in LSL2] (2of1)
     101                        if (_s->_segMan->lookupNode(curAddress))
     102                                curNode = _s->_segMan->lookupNode(curAddress);
    101103                }
     104
    102105                curAddress = curNode->succ;
    103106                curNode = _s->_segMan->lookupNode(curAddress);
    104107        }