diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-06 18:08:40 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-06 18:08:40 +0400 |
commit | 8392e83e134c4a3d29289e88376425b30c11ac42 (patch) | |
tree | 902c0e15bd8ccbcaeb99420a21d120d3c3fcb104 /intern/cycles/util/util_vector.h | |
parent | d53ed58c57d4faf8ee3817d6b4f2dbe777c7a744 (diff) |
Fix T40514: Cycles world MIS segfault
Diffstat (limited to 'intern/cycles/util/util_vector.h')
-rw-r--r-- | intern/cycles/util/util_vector.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/util/util_vector.h b/intern/cycles/util/util_vector.h index 2085177eefa..cc6e8a371ed 100644 --- a/intern/cycles/util/util_vector.h +++ b/intern/cycles/util/util_vector.h @@ -127,8 +127,10 @@ public: } else if(newsize != datasize) { T *newdata = (T*)malloc_aligned(sizeof(T)*newsize, alignment); - memcpy(newdata, data, ((datasize < newsize)? datasize: newsize)*sizeof(T)); - free_aligned(data); + if(data) { + memcpy(newdata, data, ((datasize < newsize)? datasize: newsize)*sizeof(T)); + free_aligned(data); + } data = newdata; datasize = newsize; |