fix for rare crash we have with some mango files.
authorCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 14:24:41 +0000 (14:24 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 6 Jul 2012 14:24:41 +0000 (14:24 +0000)
source/blender/render/intern/source/external_engine.c

index 5bb3e4605a2027cc09321eba5658ae5583b02bc4..e3eab0c3b345a97f5b7ab5bfa02a3d7eae4e54c6 100644 (file)
@@ -173,12 +173,16 @@ RenderResult *RE_engine_begin_result(RenderEngine *engine, int x, int y, int w,
        disprect.ymax = y + h;
 
        result = render_result_new(re, &disprect, 0, RR_USE_MEM);
-       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;
 }