From d41fc97f23cfdf7ad6a162f084bd740cd82c75b5 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Sun, 12 Jul 2009 19:45:10 +0200 Subject: [PATCH] Fix bug: 2175043. Crash when destination file not writable or path doesn't exists. --- synfig-studio/trunk/src/gtkmm/render.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 + #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(); -- 2.7.4