From 2bb4e0566cb4caec038e9d86313bd9c72439afe9 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 28 Apr 2014 14:58:36 +0000 Subject: [PATCH] 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." --- src/osg/Image.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/osg/Image.cpp b/src/osg/Image.cpp index c2ee771ea..20144a931 100644 --- a/src/osg/Image.cpp +++ b/src/osg/Image.cpp @@ -239,7 +239,7 @@ Image::Image(const Image& image,const CopyOp& copyop): { if (image._data) { - int size = image.getTotalSizeInBytesIncludingMipmaps(); + unsigned int size = image.getTotalSizeInBytesIncludingMipmaps(); setData(new unsigned char [size],USE_NEW_DELETE); unsigned char* dest_ptr = _data; for(DataIterator itr(&image); itr.valid(); ++itr)