Author: Carlos Lopez <[email protected]>
Date:   Wed Jul 20 14:27:01 2011 +0200

Consider trivial cases in standard from/to homogeneous. It avoid a crash.

---

 synfig-core/src/synfig/valuenode_bline.cpp |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/valuenode_bline.cpp 
b/synfig-core/src/synfig/valuenode_bline.cpp
index 0da9d0c..e0c00c3 100644
--- a/synfig-core/src/synfig/valuenode_bline.cpp
+++ b/synfig-core/src/synfig/valuenode_bline.cpp
@@ -301,6 +301,9 @@ synfig::std_to_hom(const ValueBase &bline, Real pos, bool 
loop, bool looped)
                if (pos < 0) pos = 0;
                if (pos > 1) pos = 1;
        }
+       // trivial cases
+       if(pos == 0.0 || pos == 1.0)
+               return pos;
        // Calculate the lengths and the total length
        Real tl=0, pl=0, l;
        std::vector<Real> lengths;
@@ -357,6 +360,9 @@ synfig::hom_to_std(const ValueBase &bline, Real pos, bool 
loop, bool looped)
                if (pos < 0) pos = 0;
                if (pos > 1) pos = 1;
        }
+       // trivial cases
+       if(pos == 0.0 || pos == 1.0)
+               return pos;
        // Calculate the lengths and the total length
        Real tl(0), pl(0), mpl, bl, l;
        std::vector<Real> lengths;


------------------------------------------------------------------------------
10 Tips for Better Web Security
Learn 10 ways to better secure your business today. Topics covered include:
Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
security Microsoft Exchange, secure Instant Messaging, and much more.
http://www.accelacomm.com/jaw/sfnl/114/51426210/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to