[osg-submissions] Fix crash in bmp writer
Farshid Lashkari
flashk at gmail.com
Tue Oct 9 15:56:17 PDT 2007
Hi Robert,
The bmp writer crashes in certain cases. It happens when the computed
size of the image data is greater than the actual image size. This
causes the memcpy call to go out of the array bounds. I modified the
code so that it copies the data during the iteration, instead of
memcpy'ing. This fixes the problems i was having.
If you are curious, the writer was crashing when trying to write an
RGB image that was 2050 x 1280. You might be able to reproduce it by
allocating an empty image of that size and writing it to a file.
Cheers,
Farshid
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ReaderWriterBMP.cpp
Type: text/x-c++src
Size: 19619 bytes
Desc: not available
Url : http://lists.openscenegraph.org/pipermail/osg-submissions-openscenegraph.org/attachments/20071009/48d54294/attachment.cpp
More information about the osg-submissions
mailing list