Hi All,
Thanks for the review. I've done another code review and feel a bit
more comfortable with the approach now, it still feels a little
awkward but this is down to slightly odd way that whole records are
read. To avoid warnings of comparison of different types I have
merged and checked in the following:
$ svn diff
Index: PaletteRecords.cpp
===================================================================
--- PaletteRecords.cpp (revision 13053)
+++ PaletteRecords.cpp (working copy)
@@ -66,11 +66,14 @@
uint32 paletteSize = in.readUInt32();
// Entries in vertex pool found by offset from start of this record.
- const int RECORD_HEADER_SIZE = 4;
- const int OFFSET = RECORD_HEADER_SIZE+sizeof(paletteSize);
+ const uint32 RECORD_HEADER_SIZE = 4;
+ const uint32 OFFSET = RECORD_HEADER_SIZE+sizeof(paletteSize);
std::string buffer(paletteSize,'\0');
- in.read(&buffer[OFFSET], paletteSize-OFFSET);
+ if (OFFSET < paletteSize)
+ {
+ in.read(&buffer[OFFSET], paletteSize-OFFSET);
+ }
// Keep a copy of the vertex pool in memory for later reference.
document.setVertexPool(new VertexPool(buffer));
Nathan could you test out the svn/trunk of the OSG to see if it works
OK for you.
Thanks,
Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org