Module: synfig
Branch: zelgadis_master
Commit: d41fc97f23cfdf7ad6a162f084bd740cd82c75b5
URL:    
http://synfig.git.sourceforge.net/git/gitweb.cgi?p=synfig;a=commit;h=d41fc97f23cfdf7ad6a162f084bd740cd82c75b5

Author: Carlos Lopez <car...@pcnuevo.(none)>
Date:   Sun Jul 12 19:45:10 2009 +0200

Fix bug: 2175043. Crash when destination file not writable or path doesn't 
exists.

---

 synfig-studio/trunk/src/gtkmm/render.cpp |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/synfig-studio/trunk/src/gtkmm/render.cpp 
b/synfig-studio/trunk/src/gtkmm/render.cpp
index 4696a47..cec4215 100644
--- a/synfig-studio/trunk/src/gtkmm/render.cpp
+++ b/synfig-studio/trunk/src/gtkmm/render.cpp
@@ -40,6 +40,8 @@
 
 #include "general.h"
 
+#include <fstream>
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -287,6 +289,14 @@ RenderSettings::on_render_pressed()
                canvas_interface_->get_ui_interface()->error(_("Unable to 
create target for ")+filename);
                return;
        }
+       // This is the only way I've found to avoid send a non writable
+       // filename path to the renderer.
+       fstream filetest (filename.c_str(), fstream::out);
+       if (filetest.fail())
+       {
+               canvas_interface_->get_ui_interface()->error(_("Unable to 
create file for ")+filename);
+               return;
+       }
 
        hide();
 


------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time, 
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Synfig-devl mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/synfig-devl

Reply via email to