From: dooglus Date: Tue, 1 Jan 2008 14:50:11 +0000 (+0000) Subject: If CloneImage() raises an exception, skip immediately to the next image rather than... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=747d826a7618fcb388fc03344c23054982e3feb2;p=synfig.git If CloneImage() raises an exception, skip immediately to the next image rather than using the uninitialised variable 'current'. git-svn-id: http://svn.voria.com/code@1245 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp b/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp index 23df13c..e6da708 100644 --- a/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp +++ b/synfig-core/trunk/src/modules/mod_magickpp/trgt_magickpp.cpp @@ -69,18 +69,18 @@ MagickLib::Image* copy_image_list(Container& container) try { current = CloneImage(iter->image(), 0, 0, Magick::MagickTrue, &exceptionInfo); + + if (!first) first = current; + + current->previous = previous; + current->next = 0; + + if ( previous != 0) previous->next = current; + previous = current; } catch(Magick::Warning warning) { synfig::warning("exception '%s'", warning.what()); } - - if (!first) first = current; - - current->previous = previous; - current->next = 0; - - if ( previous != 0) previous->next = current; - previous = current; } return first;