Moved the if (!buffer) check to infront of the memory initialization
This commit is contained in:
parent
dc19bcc7e0
commit
2125c9843b
@ -499,7 +499,6 @@ simage_tiff_load(std::istream& fin,
|
||||
osg::notify(osg::INFO)<<"bytesperpixel="<<bytesperpixel<<std::endl;
|
||||
|
||||
buffer = new unsigned char [w*h*format];
|
||||
for(unsigned char* ptr=buffer;ptr<buffer+w*h*format;++ptr) *ptr = 0;
|
||||
|
||||
if (!buffer)
|
||||
{
|
||||
@ -508,6 +507,9 @@ simage_tiff_load(std::istream& fin,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// initialize memory
|
||||
for(unsigned char* ptr=buffer;ptr<buffer+w*h*format;++ptr) *ptr = 0;
|
||||
|
||||
width = w;
|
||||
height = h;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user