Hi Nathan, You submission did make it on to osg-submissions and I reviewed it but wasn't clear on the intention of original code and the wasn't comfortable with the modification so I posted a query about the original function to Paul Martz but haven't yet had a reply.
Robert. On 28 March 2012 22:20, Nathan Monteleone <[email protected]> wrote: > > nbmont wrote: >> Hi, >> >> Saw this in vs2010 when I tried to load an .flt file freshly made in creator >> but with nothing in it. You get a string index out of range exception in >> PaletterRecords.cpp, line 73 where it does >> >> 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); >> >> std::string buffer(paletteSize,'\0'); >> in.read(&buffer[OFFSET], paletteSize-OFFSET); >> >> The problem is that for an empty vertex palette, OFFSET equals paletteSize, >> so OFFSET is past the end of buffer. This code normally doesn't have a >> problem because it's reading 0 bytes into this location anyway, but iterator >> debugging catches the out of range index. >> >> A simple if (OFFSET < buffer.size()) fixes the problem. I attached an >> amended file with the fix, plus a test model that reproduces the problem. >> >> I know it's a little silly to be loading empty .flt files, but I can't >> control what people try to load and *technically* it's a valid file. >> >> Hope that's helpful -- thanks for all the wonderful work on OSG. >> >> Nathan > > > bump -- did this make it to the e-mail list? > > ------------------ > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=46657#46657 > > > > > > _______________________________________________ > osg-submissions mailing list > [email protected] > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
