From 9024b6789eb368c0cb4dc05e6659ddca9f362fbd Mon Sep 17 00:00:00 2001 From: Janne Karhu Date: Thu, 13 Jan 2011 10:10:13 +0000 Subject: Possible fix for [#24924] crash-Fluids * In some rare cases gzread has problems with the fluid files. This could be minor file corruption or some strange thread issue, but checking the amount of read bytes always after read seems to give a graceful way out. --- source/blender/modifiers/intern/MOD_fluidsim_util.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'source/blender/modifiers/intern/MOD_fluidsim_util.c') diff --git a/source/blender/modifiers/intern/MOD_fluidsim_util.c b/source/blender/modifiers/intern/MOD_fluidsim_util.c index 1ff997f92d7..7392dfbd7d3 100644 --- a/source/blender/modifiers/intern/MOD_fluidsim_util.c +++ b/source/blender/modifiers/intern/MOD_fluidsim_util.c @@ -169,7 +169,7 @@ void fluidsim_free(FluidsimModifierData *fluidmd) /* read .bobj.gz file into a fluidsimDerivedMesh struct */ DerivedMesh *fluidsim_read_obj(char *filename) { - int wri,i,j; + int wri = 0,i,j; float wrf; int gotBytes; gzFile gzf; @@ -193,28 +193,30 @@ DerivedMesh *fluidsim_read_obj(char *filename) numverts = wri; // skip verts - for(i=0; i