Author: Carlos Lopez <[email protected]>
Date:   Sun Jul 22 10:20:47 2012 +0200

Layer_Bitmap: Fix crash of attempt to call a cairo_surface_destroy on a non 
initialized not null pointer.

---

 synfig-core/src/synfig/layer_bitmap.cpp |    1 +
 synfig-core/src/synfig/layer_bitmap.h   |    2 ++
 2 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/synfig-core/src/synfig/layer_bitmap.cpp 
b/synfig-core/src/synfig/layer_bitmap.cpp
index 9af2b35..31bcc7c 100644
--- a/synfig-core/src/synfig/layer_bitmap.cpp
+++ b/synfig-core/src/synfig/layer_bitmap.cpp
@@ -63,6 +63,7 @@ using namespace etl;
 synfig::Layer_Bitmap::Layer_Bitmap():
     Layer_Composite    (1.0,Color::BLEND_COMPOSITE),
        method                  (SOFTWARE),
+       cs_                             (NULL),
        tl                              (-0.5,0.5),
        br                              (0.5,-0.5),
        c                               (1),
diff --git a/synfig-core/src/synfig/layer_bitmap.h 
b/synfig-core/src/synfig/layer_bitmap.h
index cd75d7d..fe9470c 100644
--- a/synfig-core/src/synfig/layer_bitmap.h
+++ b/synfig-core/src/synfig/layer_bitmap.h
@@ -61,6 +61,8 @@ public:
        Real gamma_adjust;
 
        Layer_Bitmap();
+       ~Layer_Bitmap() { 
+       if(cs_!=NULL) cairo_surface_destroy(cs_); }
 
        virtual bool set_param(const String & param, const ValueBase & value);
 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to