Cycles: Fix crash in empty scenes
authorJulian Eisel <eiseljulian@gmail.com>
Tue, 9 Aug 2016 02:32:38 +0000 (04:32 +0200)
committerJulian Eisel <eiseljulian@gmail.com>
Tue, 9 Aug 2016 02:32:38 +0000 (04:32 +0200)
To recreate, just delete default cube and render.

Simple fix, but @maiself or @sergey may want to double-check ;)

intern/cycles/render/object.cpp

index 28cc4fe58fa42ad53d980245f739254664e06171..62076f3a86598b683fe1f6663cfc851fc7b061a3 100644 (file)
@@ -611,6 +611,9 @@ void ObjectManager::device_update_flags(Device *device,
 
 void ObjectManager::device_update_patch_map_offsets(Device *device, DeviceScene *dscene, Scene *scene)
 {
 
 void ObjectManager::device_update_patch_map_offsets(Device *device, DeviceScene *dscene, Scene *scene)
 {
+       if (scene->objects.size() == 0)
+               return;
+
        uint4* objects = (uint4*)dscene->objects.get_data();
 
        bool update = false;
        uint4* objects = (uint4*)dscene->objects.get_data();
 
        bool update = false;