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.
This commit is contained in:
2015-06-30 23:23:38 +02:00
parent 5e9b43cc61
commit cf1bac3f69

View File

@@ -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];
}