diff --git a/src/osgPlugins/osg/BinaryStreamOperator.h b/src/osgPlugins/osg/BinaryStreamOperator.h index 93c721d0d..3505dfb56 100644 --- a/src/osgPlugins/osg/BinaryStreamOperator.h +++ b/src/osgPlugins/osg/BinaryStreamOperator.h @@ -263,8 +263,9 @@ public: { if ( _supportBinaryBrackets && _beginPositions.size()>0 ) { - std::streampos pos = _beginPositions.back() + _blockSizes.back(); - _in->seekg( pos, std::ios_base::beg ); + std::streampos position(_beginPositions.back()); + position += _blockSizes.back(); + _in->seekg( position ); _beginPositions.pop_back(); _blockSizes.pop_back(); } @@ -272,7 +273,7 @@ public: protected: std::vector _beginPositions; - std::vector _blockSizes; + std::vector _blockSizes; }; #endif diff --git a/src/osgPlugins/osga/OSGA_Archive.cpp b/src/osgPlugins/osga/OSGA_Archive.cpp index 3d3ac7e33..e6ec2fcc4 100644 --- a/src/osgPlugins/osga/OSGA_Archive.cpp +++ b/src/osgPlugins/osga/OSGA_Archive.cpp @@ -650,7 +650,7 @@ protected: } if ( newpos<0 || newpos>_numChars ) return -1; - if ( (std::streamoff)_streambuf->pubseekpos( STREAM_POS(_startPos+newpos), which) < 0 ) return -1; + if ( ARCHIVE_POS(_streambuf->pubseekpos( STREAM_POS(_startPos+newpos), which)) < 0 ) return -1; _curPos = newpos; return _curPos; }