Fix [#34561]: Possible smoke crash if smoke flow had lower density than adaptive...
authorMiika Hamalainen <blender@miikah.org>
Sun, 10 Mar 2013 19:12:40 +0000 (19:12 +0000)
committerMiika Hamalainen <blender@miikah.org>
Sun, 10 Mar 2013 19:12:40 +0000 (19:12 +0000)
source/blender/blenkernel/intern/smoke.c

index ca3908a..435e815 100644 (file)
@@ -1776,6 +1776,8 @@ static void update_flowsfluids(Scene *scene, Object *ob, SmokeDomainSettings *sd
                                                        dy = gy - sds->res_min[1];
                                                        dz = gz - sds->res_min[2];
                                                        d_index = smoke_get_index(dx, sds->res[0], dy, sds->res[1], dz);
+                                                       /* make sure emission cell is inside the new domain boundary */
+                                                       if (dx < 0 || dy < 0 || dz < 0 || dx >= sds->res[0] || dy >= sds->res[1] || dz >= sds->res[2]) continue;
 
                                                        if (sfs->type == MOD_SMOKE_FLOW_TYPE_OUTFLOW) { // outflow
                                                                apply_outflow_fields(d_index, density, heat, fuel, react, color_r, color_g, color_b);