From Pjotr Svetachov, "I had the osgvolume example crash on me when loading large volume

datasets due to an overflow in image.cpp after a unneeded cast from
unsigned int to int. Here is a small fix."
This commit is contained in:
Robert Osfield 2014-04-28 14:58:36 +00:00
parent 4dd3e3562f
commit 2bb4e0566c

View File

@ -239,7 +239,7 @@ Image::Image(const Image& image,const CopyOp& copyop):
{ {
if (image._data) if (image._data)
{ {
int size = image.getTotalSizeInBytesIncludingMipmaps(); unsigned int size = image.getTotalSizeInBytesIncludingMipmaps();
setData(new unsigned char [size],USE_NEW_DELETE); setData(new unsigned char [size],USE_NEW_DELETE);
unsigned char* dest_ptr = _data; unsigned char* dest_ptr = _data;
for(DataIterator itr(&image); itr.valid(); ++itr) for(DataIterator itr(&image); itr.valid(); ++itr)