diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 20:38:11 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-04 20:38:11 +0400 |
commit | 0c318c4a476e013ffedf7786ec77e492352d0bcb (patch) | |
tree | 00d877380b89d7d176fc302be7d32626d165f30f /intern | |
parent | d710638c47491619f14495ffb130b183019782c5 (diff) |
Fix (harmless) uninitialized memory usage in BVH binning.
Fix unneeded warnings with c++ guardedalloc, delete NULL is valid.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/bvh/bvh_binning.cpp | 1 | ||||
-rw-r--r-- | intern/guardedalloc/cpp/mallocn.cpp | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_binning.cpp b/intern/cycles/bvh/bvh_binning.cpp index 661541a8d23..e4b88584a33 100644 --- a/intern/cycles/bvh/bvh_binning.cpp +++ b/intern/cycles/bvh/bvh_binning.cpp @@ -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 */ diff --git a/intern/guardedalloc/cpp/mallocn.cpp b/intern/guardedalloc/cpp/mallocn.cpp index 97e68d06ace..130fcb6960b 100644 --- a/intern/guardedalloc/cpp/mallocn.cpp +++ b/intern/guardedalloc/cpp/mallocn.cpp @@ -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); } |