forked from bartvdbraak/blender
Fix (harmless) uninitialized memory usage in BVH binning.
Fix unneeded warnings with c++ guardedalloc, delete NULL is valid.
This commit is contained in:
parent
d710638c47
commit
0c318c4a47
@ -122,6 +122,7 @@ BVHObjectBinning::BVHObjectBinning(const BVHRange& job, BVHReference *prims)
|
||||
bx = merge(bx,bin_bounds[i][0]); r_area[i][0] = bx.half_area();
|
||||
by = merge(by,bin_bounds[i][1]); r_area[i][1] = by.half_area();
|
||||
bz = merge(bz,bin_bounds[i][2]); r_area[i][2] = bz.half_area();
|
||||
r_area[i][3] = r_area[i][2];
|
||||
}
|
||||
|
||||
/* sweep from left to right and compute SAH */
|
||||
|
@ -41,5 +41,7 @@ void* operator new (size_t size, const char *str)
|
||||
|
||||
void operator delete (void *p)
|
||||
{
|
||||
MEM_freeN(p);
|
||||
/* delete NULL is valid in c++ */
|
||||
if(p)
|
||||
MEM_freeN(p);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user