fix for crash when render result is NULL
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 14:26:22 +0000 (14:26 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 14:26:22 +0000 (14:26 +0000)
intern/cycles/blender/blender_session.cpp

index 0e4ae0675b6d148b9c1a08473c1592d2c49c655a..3cc07a186cbd7d88f0e8089ea80a49a0a07782df 100644 (file)
@@ -199,6 +199,12 @@ void BlenderSession::write_render_buffers(RenderBuffers *buffers)
 
        /* get render result */
        BL::RenderResult b_rr = begin_render_result(b_engine, x, y, w, h, b_rlay_name.c_str());
+
+       /* can happen if the intersected rectangle gives 0 width or height */
+       if (b_rr.ptr.data == NULL) {
+               return;
+       }
+
        BL::RenderResult::layers_iterator b_single_rlay;
        b_rr.layers.begin(b_single_rlay);
        BL::RenderLayer b_rlay = *b_single_rlay;