From 9eef5aa27e7eff53960661f9a7d9157e8e79c811 Mon Sep 17 00:00:00 2001 From: dooglus Date: Sun, 7 Oct 2007 22:28:43 +0000 Subject: [PATCH] Fix a crash in the warp layer when the bounding_rect gets very small. git-svn-id: http://svn.voria.com/code@858 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/modules/lyr_std/warp.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/synfig-core/trunk/src/modules/lyr_std/warp.cpp b/synfig-core/trunk/src/modules/lyr_std/warp.cpp index 24624ae..60a41c7 100644 --- a/synfig-core/trunk/src/modules/lyr_std/warp.cpp +++ b/synfig-core/trunk/src/modules/lyr_std/warp.cpp @@ -614,6 +614,16 @@ Warp::accelerated_render(Context context,Surface *surface,int quality, const Ren Point min_point(bounding_rect.get_min()); Point max_point(bounding_rect.get_max()); + // we're going to divide by the different of these pairs soon; + // if they're the same, we'll be dividing by zero, and we don't + // want to do that! + // \todo what should we do in this case? + if (min_point[0] == max_point[0] || min_point[1] == max_point[1]) + { + surface->set_wh(renddesc.get_w(),renddesc.get_h()); + surface->clear(); + return true; + } if(tl[0]>br[0]) { -- 2.7.4