diff options
author | Walter van Niftrik | 2010-01-26 19:51:08 +0000 |
---|---|---|
committer | Walter van Niftrik | 2010-01-26 19:51:08 +0000 |
commit | 473d8b7c2fb8fccdf7716308a5faced5e6259566 (patch) | |
tree | 4059b553ea25867166db9718aff8832beba085cb /engines/sci/engine/kpathing.cpp | |
parent | 9861b04b935b84424b5b7950a2398dbfb44a99f9 (diff) | |
download | scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.tar.gz scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.tar.bz2 scummvm-rg350-473d8b7c2fb8fccdf7716308a5faced5e6259566.zip |
SCI: Add string support for odd-offset pointers into reg_t-based segments.
svn-id: r47572
Diffstat (limited to 'engines/sci/engine/kpathing.cpp')
-rw-r--r-- | engines/sci/engine/kpathing.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp index cfe3cb38a3..9bd3912aa7 100644 --- a/engines/sci/engine/kpathing.cpp +++ b/engines/sci/engine/kpathing.cpp @@ -260,7 +260,7 @@ struct PathfindingState { static Common::Point read_point(SegManager *segMan, reg_t list, int offset) { SegmentRef list_r = segMan->dereference(list); - if (!list_r.isValid()) { + if (!list_r.isValid() || list_r.skipByte) { warning("read_point(): Attempt to dereference invalid pointer %04x:%04x", PRINT_REG(list)); } Common::Point point; @@ -1740,7 +1740,7 @@ static reg_t output_path(PathfindingState *p, EngineState *s) { // Allocate memory for path, plus 3 extra for appended point, prepended point and sentinel output = allocateOutputArray(s->_segMan, path_len + 3); SegmentRef arrayRef = s->_segMan->dereference(output); - assert(arrayRef.isValid()); + assert(arrayRef.isValid() && !arrayRef.skipByte); if (unreachable) { // If pathfinding failed we only return the path up to vertex_start @@ -1860,7 +1860,7 @@ reg_t kAvoidPath(EngineState *s, int argc, reg_t *argv) { printf("[avoidpath] Returning direct path from start point to end point\n"); output = allocateOutputArray(s->_segMan, 3); SegmentRef arrayRef = s->_segMan->dereference(output); - assert(arrayRef.isValid()); + assert(arrayRef.isValid() && !arrayRef.skipByte); writePoint(arrayRef, 0, start); writePoint(arrayRef, 1, end); |