svn merge ^/trunk/blender -r48674:48681
[blender.git] / source / blender / render / intern / source / external_engine.c
index 52ac5b1325f39ad4109f2ea2c8b471e8cc0aa0bb..2b5ccae7df715415fb6be4d72a4d562acba6b112 100644 (file)
@@ -176,12 +176,16 @@ RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w,
        result = render_result_new(re, &disprect, 0, RR_USE_MEM, layername);
 
        /* todo: make this thread safe */
-       BLI_addtail(&engine->fullresult, result);
-       
-       result->tilerect.xmin += re->disprect.xmin;
-       result->tilerect.xmax += re->disprect.xmin;
-       result->tilerect.ymin += re->disprect.ymin;
-       result->tilerect.ymax += re->disprect.ymin;
+
+       /* can be NULL if we CLAMP the width or height to 0 */
+       if (result) {
+               BLI_addtail(&engine->fullresult, result);
+
+               result->tilerect.xmin += re->disprect.xmin;
+               result->tilerect.xmax += re->disprect.xmin;
+               result->tilerect.ymin += re->disprect.ymin;
+               result->tilerect.ymax += re->disprect.ymin;
+       }
 
        return result;
 }