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:
Sergey Sharybin 2015-06-30 23:23:38 +02:00
parent 5e9b43cc61
commit cf1bac3f69
Notes: blender-bot 2023-02-14 08:56:50 +01:00
Referenced by issue #45369, Temp-full screen layout kept saved without user "knowledge"; also giving troubles with layout navigation/ui freezing.
Referenced by issue #45258, Deleting brush closes Paint panel and creates duplicate brush when re-entering a Paint Mode
1 changed files with 5 additions and 2 deletions

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