Fix segfault when rendering http://dooglus.rincevent.net/synfig/crasher3.sif
authorpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 14 Aug 2007 09:50:09 +0000 (09:50 +0000)
committerpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Tue, 14 Aug 2007 09:50:09 +0000 (09:50 +0000)
git-svn-id: http://svn.voria.com/code@552 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/synfig/canvas.cpp

index aba6730..dcb702f 100644 (file)
@@ -1039,7 +1039,9 @@ synfig::optimize_layers(Context context, Canvas::Handle op_canvas)
                if(layer->get_name()=="PasteCanvas" && paste_canvas->get_time_offset()==0)
                {
                        Canvas::Handle sub_canvas(Canvas::create_inline(op_canvas));
-                       optimize_layers(paste_canvas->get_sub_canvas()->get_context(),sub_canvas);
+                       Canvas::Handle paste_sub_canvas = paste_canvas->get_sub_canvas();
+                       if(paste_sub_canvas)
+                               optimize_layers(paste_sub_canvas->get_context(),sub_canvas);
 //#define SYNFIG_OPTIMIZE_PASTE_CANVAS 1
 
 #ifdef SYNFIG_OPTIMIZE_PASTE_CANVAS