[Bf-blender-cvs] [5d10814ccce] blender-v2.90-release: Fix T79626: 2.91 Mantaflow crash when adaptive domain + noise are enabled
SebastiaÌn Barschkis
noreply at git.blender.org
Mon Sep 21 09:50:34 CEST 2020
Commit: 5d10814cccecd2a838fdaf6d991d5e9a335a35eb
Author: Sebastián Barschkis
Date: Thu Sep 10 11:09:49 2020 +0200
Branches: blender-v2.90-release
https://developer.blender.org/rB5d10814cccecd2a838fdaf6d991d5e9a335a35eb
Fix T79626: 2.91 Mantaflow crash when adaptive domain + noise are enabled
Crash was caused by an incorect domain size of the noise solver and an index out of bounds.
===================================================================
M source/blender/blenkernel/intern/fluid.c
===================================================================
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 079b436a3ea..f0f01df723e 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -181,7 +181,6 @@ void BKE_fluid_reallocate_copy_fluid(FluidDomainSettings *fds,
float *n_b = manta_smoke_get_color_b(fds->fluid);
/* Noise smoke fields. */
- int wt_res_old[3];
float *o_wt_dens = manta_noise_get_density(fluid_old);
float *o_wt_react = manta_noise_get_react(fluid_old);
float *o_wt_flame = manta_noise_get_flame(fluid_old);
@@ -210,6 +209,7 @@ void BKE_fluid_reallocate_copy_fluid(FluidDomainSettings *fds,
float *n_wt_tcv2 = manta_noise_get_texture_v2(fds->fluid);
float *n_wt_tcw2 = manta_noise_get_texture_w2(fds->fluid);
+ int wt_res_old[3];
manta_noise_get_res(fluid_old, wt_res_old);
for (int z = o_min[2]; z < o_max[2]; z++) {
@@ -3790,6 +3790,13 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
}
}
+ /* Adaptive domain needs to know about current state, so save it here. */
+ int o_res[3], o_min[3], o_max[3], o_shift[3];
+ copy_v3_v3_int(o_res, fds->res);
+ copy_v3_v3_int(o_min, fds->res_min);
+ copy_v3_v3_int(o_max, fds->res_max);
+ copy_v3_v3_int(o_shift, fds->shift);
+
/* Ensure that time parameters are initialized correctly before every step. */
float fps = scene->r.frs_sec / scene->r.frs_sec_base;
fds->frame_length = DT_DEFAULT * (25.0f / fps) * fds->time_scale;
@@ -3870,8 +3877,6 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
bool with_gdomain;
with_gdomain = (fds->guide_source == FLUID_DOMAIN_GUIDE_SRC_DOMAIN);
- int o_res[3], o_min[3], o_max[3], o_shift[3];
-
/* Cache mode specific settings. */
switch (mode) {
case FLUID_DOMAIN_CACHE_ALL:
@@ -3935,12 +3940,6 @@ static void BKE_fluid_modifier_processDomain(FluidModifierData *fmd,
break;
}
- /* Adaptive domain needs to know about current state, so save it here. */
- copy_v3_v3_int(o_res, fds->res);
- copy_v3_v3_int(o_min, fds->res_min);
- copy_v3_v3_int(o_max, fds->res_max);
- copy_v3_v3_int(o_shift, fds->shift);
-
bool read_partial = false, read_all = false;
/* Try to read from cache and keep track of read success. */
if (read_cache) {
More information about the Bf-blender-cvs
mailing list