From 6d12cf6d823b693ff8342752b00fdea813cff503 Mon Sep 17 00:00:00 2001 From: dooglus Date: Wed, 24 Oct 2007 21:56:13 +0000 Subject: [PATCH] Don't allow 'splits' to be less than 1, or we get a division by zero and an infinite loop. git-svn-id: http://svn.voria.com/code@964 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/mod_particle/plant.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/synfig-core/trunk/src/modules/mod_particle/plant.cpp b/synfig-core/trunk/src/modules/mod_particle/plant.cpp index c97d3ae..7affc15 100644 --- a/synfig-core/trunk/src/modules/mod_particle/plant.cpp +++ b/synfig-core/trunk/src/modules/mod_particle/plant.cpp @@ -284,7 +284,11 @@ Plant::set_param(const String & param, const ValueBase &value) else if (step > 1) step=1; }); - IMPORT_PLUS(splits,needs_sync_=true); + IMPORT_PLUS(splits,{ + needs_sync_=true; + if (splits < 1) + splits = 1; + }); IMPORT_PLUS(sprouts,needs_sync_=true); IMPORT_PLUS(random_factor,needs_sync_=true); IMPORT_PLUS(drag,needs_sync_=true); -- 2.7.4