Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-07-01 00:23:38 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-07-01 00:41:19 +0300
commitcf1bac3f6900a896a7964716beaaef581d23efec (patch)
tree835aa7692065cdba1ddc90f2691a2751f0e26398
parent5e9b43cc616922d3dca8567e64a568e8a1fc9012 (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.
-rw-r--r--intern/cycles/device/device_memory.h7
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];
}