diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-20 19:14:50 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-03-20 19:14:50 +0300 |
commit | 919a6654974f40c553ba30a4aba89e9d02251246 (patch) | |
tree | 30b7bba6c014a0818121dc30b6ca220c8181833a /intern | |
parent | 8ff4c53e63dc1eb7f4855915dd45d044b854e301 (diff) |
Cycles: Avoid memcpy of intersecting memory
Could happen when assignment happens to self during sorting.
Diffstat (limited to 'intern')
-rw-r--r-- | intern/cycles/bvh/bvh_params.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/bvh/bvh_params.h b/intern/cycles/bvh/bvh_params.h index 99bfd9449da..af8d8eeb3ee 100644 --- a/intern/cycles/bvh/bvh_params.h +++ b/intern/cycles/bvh/bvh_params.h @@ -113,7 +113,9 @@ public: __forceinline int prim_type() const { return type; } BVHReference& operator=(const BVHReference &arg) { - memcpy(this, &arg, sizeof(BVHReference)); + if(&arg != this) { + memcpy(this, &arg, sizeof(BVHReference)); + } return *this; } |