From 2428e07f35741b2b730ba40bd58d658541072dee Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 26 Jun 2014 09:33:56 +0000 Subject: [PATCH] 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 --- src/osgPlugins/osg/BinaryStreamOperator.h | 7 ++++--- src/osgPlugins/osga/OSGA_Archive.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) 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; }