From 05b4370c21b3abf7a1ff6aa83194cf95ab73579c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 5 Mar 2009 20:37:53 +0000 Subject: Fix for bug #2664460: Various SeekableReadStream::seek() implementations (as well as our unit tests, ouch) handled SEEK_END incorrectly (using -offset instead of offset), contrary to what the docs said and what fseek does. Hopefully I found and fixed all affected parts, but still watch out for regressions svn-id: r39135 --- engines/gob/inter_v1.cpp | 2 +- engines/gob/inter_v2.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'engines/gob') diff --git a/engines/gob/inter_v1.cpp b/engines/gob/inter_v1.cpp index b6b82662bc..9c4679ca35 100644 --- a/engines/gob/inter_v1.cpp +++ b/engines/gob/inter_v1.cpp @@ -2222,7 +2222,7 @@ bool Inter_v1::o1_readData(OpFuncParams ¶ms) { _vm->_draw->animateCursor(4); if (offset < 0) - stream->seek(-offset - 1, SEEK_END); + stream->seek(offset + 1, SEEK_END); else stream->seek(offset); diff --git a/engines/gob/inter_v2.cpp b/engines/gob/inter_v2.cpp index 48ce40a335..8859f68ff6 100644 --- a/engines/gob/inter_v2.cpp +++ b/engines/gob/inter_v2.cpp @@ -1979,7 +1979,7 @@ bool Inter_v2::o2_readData(OpFuncParams ¶ms) { _vm->_draw->animateCursor(4); if (offset < 0) - stream->seek(-offset - 1, SEEK_END); + stream->seek(offset + 1, SEEK_END); else stream->seek(offset); -- cgit v1.2.3