From Pjotr Svetachov, "Here is a small fix for a overflow when editing large 3d volume data."

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/branches/OpenSceneGraph-3.2@14328 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-06-30 08:46:53 +00:00
parent a4a684cb07
commit 5aa7acd92b

View File

@@ -302,13 +302,13 @@ class OSG_EXPORT Image : public BufferData
* take care to access the data per row rather than treating the whole data as a single block. */
inline const unsigned char* data() const { return _data; }
inline unsigned char* data(int column, int row=0,int image=0)
inline unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0)
{
if (!_data) return NULL;
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();
}
inline const unsigned char* data(int column, int row=0,int image=0) const
inline const unsigned char* data(unsigned int column, unsigned int row = 0, unsigned int image = 0) const
{
if (!_data) return NULL;
return _data+(column*getPixelSizeInBits())/8+row*getRowStepInBytes()+image*getImageSizeInBytes();