From Aurelien Albert, "This submission fix all my problems with reading / writing "osgb" files inside "osga" archive with final archive size > 2 Go, with Windows OS (didn't tested with Linux)"

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14287 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-26 09:33:56 +00:00
parent 86ddbc7ad9
commit 2428e07f35
2 changed files with 5 additions and 4 deletions

View File

@@ -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<std::streampos> _beginPositions;
std::vector<std::streampos> _blockSizes;
std::vector<int> _blockSizes;
};
#endif

View File

@@ -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;
}