diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-01 00:23:38 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-07-01 00:41:19 +0300 |
commit | cf1bac3f6900a896a7964716beaaef581d23efec (patch) | |
tree | 835aa7692065cdba1ddc90f2691a2751f0e26398 /intern/cycles/device | |
parent | 5e9b43cc616922d3dca8567e64a568e8a1fc9012 (diff) |
Cycles: Solve some harmless NULL pointer magic
Was harmless but confused some sanity checks, also kinda makes sense
to be more verbose about what's going on there.
Diffstat (limited to 'intern/cycles/device')
-rw-r--r-- | intern/cycles/device/device_memory.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/intern/cycles/device/device_memory.h b/intern/cycles/device/device_memory.h index 7df2bc1a0c2..ba79f8c88ae 100644 --- a/intern/cycles/device/device_memory.h +++ b/intern/cycles/device/device_memory.h @@ -212,11 +212,14 @@ public: { data_size = width * ((height == 0)? 1: height) * ((depth == 0)? 1: depth); data.resize(data_size); - data_pointer = (device_ptr)&data[0]; data_width = width; data_height = height; data_depth = depth; - + if(data_size == 0) { + data_pointer = 0; + return NULL; + } + data_pointer = (device_ptr)&data[0]; return &data[0]; } |