[Bf-blender-cvs] [1ddcbac9a0c] fluid-mantaflow: added some sanity checks to prevent illegal cache access

Sebastián Barschkis noreply at git.blender.org
Tue May 8 02:06:54 CEST 2018


Commit: 1ddcbac9a0ceb938b2e8f87bf12df731bfef439a
Author: Sebastián Barschkis
Date:   Tue May 8 02:06:43 2018 +0200
Branches: fluid-mantaflow
https://developer.blender.org/rB1ddcbac9a0ceb938b2e8f87bf12df731bfef439a

added some sanity checks to prevent illegal cache access

===================================================================

M	intern/mantaflow/intern/FLUID.cpp

===================================================================

diff --git a/intern/mantaflow/intern/FLUID.cpp b/intern/mantaflow/intern/FLUID.cpp
index 99937965757..8fbdddd6ee4 100644
--- a/intern/mantaflow/intern/FLUID.cpp
+++ b/intern/mantaflow/intern/FLUID.cpp
@@ -1026,6 +1026,8 @@ int FLUID::updateFlipStructures(SmokeModifierData *smd, int framenr)
 	if (FLUID::with_debug)
 		std::cout << "FLUID::updateFlipStructures()" << std::endl;
 
+	if (!mUsingLiquid) return 0;
+
 	std::ostringstream ss;
 	char cacheDir[FILE_MAX], helperDir[FILE_MAX];
 	cacheDir[0] = '\0';
@@ -1056,6 +1058,8 @@ int FLUID::updateMeshStructures(SmokeModifierData *smd, int framenr)
 	if (FLUID::with_debug)
 		std::cout << "FLUID::updateMeshStructures()" << std::endl;
 
+	if (!mUsingMesh) return 0;
+
 	std::ostringstream ss;
 	char cacheDir[FILE_MAX], helperDir[FILE_MAX];
 	cacheDir[0] = '\0';
@@ -1077,6 +1081,8 @@ int FLUID::updateParticleStructures(SmokeModifierData *smd, int framenr)
 	if (FLUID::with_debug)
 		std::cout << "FLUID::updateParticleStructures()" << std::endl;
 
+	if (!mUsingDrops && !mUsingBubbles && !mUsingFloats && !mUsingTracers) return 0;
+
 	std::ostringstream ss;
 	char cacheDir[FILE_MAX], helperDir[FILE_MAX];
 	cacheDir[0] = '\0';
@@ -1147,6 +1153,8 @@ int FLUID::readData(SmokeModifierData *smd, int framenr)
 	if (with_debug)
 		std::cout << "FLUID::readData()" << std::endl;
 
+	if (!mUsingSmoke && !mUsingLiquid) return 0;
+
 	std::ostringstream ss;
 	std::vector<std::string> pythonCommands;
 
@@ -1203,6 +1211,9 @@ int FLUID::readMesh(SmokeModifierData *smd, int framenr)
 	// dummmy function, use updateMeshFromFile
 	if (with_debug)
 		std::cout << "FLUID::readMesh() - dummmy function, use updateMeshFromFile()" << std::endl;
+
+	if (!mUsingMesh) return 0;
+
 	return 1;
 }



More information about the Bf-blender-cvs mailing list