diff options
Diffstat (limited to 'intern/cycles')
-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; |