From: Carlos Lopez Date: Sun, 12 Jul 2009 17:45:10 +0000 (+0200) Subject: Fix bug: 2175043. Crash when destination file not writable or path doesn't exists. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d41fc97f23cfdf7ad6a162f084bd740cd82c75b5;p=synfig.git Fix bug: 2175043. Crash when destination file not writable or path doesn't exists. --- 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();