Added check to allocateImage() so that if the pixel size wouldn't be computed

unless valid _data already existed on the object.
This commit is contained in:
Robert Osfield 2003-07-23 08:18:19 +00:00
parent ee30f2e30c
commit a36d45e68b

View File

@ -302,7 +302,9 @@ void Image::allocateImage(int s,int t,int r,
{
_mipmapData.clear();
unsigned int previousTotalSize = computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing)*_t*_r;
unsigned int previousTotalSize = 0;
if (_data) previousTotalSize = computeRowWidthInBytes(_s,_pixelFormat,_dataType,_packing)*_t*_r;
unsigned int newTotalSize = computeRowWidthInBytes(s,format,type,packing)*t*r;