diff --git a/include/osgDB/Archive b/include/osgDB/Archive index 9e5adeb7b..97008b00e 100644 --- a/include/osgDB/Archive +++ b/include/osgDB/Archive @@ -120,7 +120,7 @@ class OSGDB_EXPORT Archive : public ReaderWriter inline bool spaceAvailable(pos_type, size_type, const std::string& filename) const { - unsigned requiredSize = sizeof(pos_type)+sizeof(unsigned int)+filename.size(); + unsigned requiredSize = sizeof(pos_type)+sizeof(size_type)+sizeof(unsigned int)+filename.size(); return (_offsetOfNextAvailableSpace + requiredSize)<_blockSize; } diff --git a/src/osgDB/Archive.cpp b/src/osgDB/Archive.cpp index c93980bd6..4828e59a3 100644 --- a/src/osgDB/Archive.cpp +++ b/src/osgDB/Archive.cpp @@ -40,6 +40,7 @@ Archive::IndexBlock::IndexBlock(unsigned int blockSize): _requiresWrite(false), _filePosition(0), _blockSize(0), + _filePositionNextIndexBlock(0), _offsetOfNextAvailableSpace(0), _data(0) { @@ -198,7 +199,7 @@ void Archive::IndexBlock::write(std::ostream& out) out.write(reinterpret_cast(_data),_blockSize); - osg::notify(osg::INFO)<<"Archive::IndexBlock::write()"<setPositionNextIndexBlock(_output.tellp()); indexBlock = new IndexBlock(blockSize);