From: xerakko Date: Sat, 18 Nov 2006 09:37:35 +0000 (+0000) Subject: Applied the following dooglus patches from the sourceforge tracker: X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=75635270584b5775982adbd70250a0ebc7e3e76b;p=synfig.git Applied the following dooglus patches from the sourceforge tracker: synfig - 1576355: main1 - variable used after it's been free'd - 1576389: main2 - missing command line argument can crash synfig - 1571307: initialise - several variables are used before they are set - 1576373: gif1 - invalid palette entries are accessed - 1568922: blur2 - poor granularity in blur sizes - 1569078: typo: "aperature" synfigstudio - 1571307: initialise, initialise2 - several variables are used before they are set - gamma settings were breaking due to using the localised form and causing weird colours - 1570191: distance - Widget_Distance don't notice when the units are changed - 1570319: blinewidth - default bline width is accessed before it is set git-svn-id: http://svn.voria.com/code@229 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_gif/trgt_gif.cpp b/synfig-core/trunk/src/modules/mod_gif/trgt_gif.cpp index 477b233..54a6e03 100644 --- a/synfig-core/trunk/src/modules/mod_gif/trgt_gif.cpp +++ b/synfig-core/trunk/src/modules/mod_gif/trgt_gif.cpp @@ -165,7 +165,7 @@ gif::output_curr_palette() // Output the color table for(i=0;i<256/(1<<(8-rootsize));i++) { -// if(i && (i-1) &surface, //horizontal part if(size[0]) { - int length=(int)(abs((float)w/(resolution[0]))*size[0]*0.5+1); - length=std::max(1,length); + Real length=abs((float)w/(resolution[0]))*size[0]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 - etl::hbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::hbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::hbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::hbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=worksurface; //vertical part if(size[1]) { - int length=(int)(abs((float)h/(resolution[1]))*size[1]*0.5+1); - length=std::max(1,length); + Real length=abs((float)h/(resolution[1]))*size[1]*0.5+1; + length=std::max(1.0,length); //two box blurs produces: 1 2 1 on the horizontal 1 2 1 - etl::vbox_blur(worksurface.begin(),w,h,length*3/4,temp_surface.begin()); - etl::vbox_blur(temp_surface.begin(),w,h,length*3/4,worksurface.begin()); + etl::vbox_blur(worksurface.begin(),w,h,(int)(length*3/4),temp_surface.begin()); + etl::vbox_blur(temp_surface.begin(),w,h,(int)(length*3/4),worksurface.begin()); } //else temp_surface2=temp_surface2; diff --git a/synfig-core/trunk/src/synfig/layer_motionblur.cpp b/synfig-core/trunk/src/synfig/layer_motionblur.cpp index b1782ee..6ac3673 100644 --- a/synfig-core/trunk/src/synfig/layer_motionblur.cpp +++ b/synfig-core/trunk/src/synfig/layer_motionblur.cpp @@ -118,7 +118,7 @@ Layer_MotionBlur::get_param_vocab()const //ret=Layer_Composite::get_param_vocab(); ret.push_back(ParamDesc("aperture") - .set_local_name(_("Aperature")) + .set_local_name(_("Aperture")) .set_description(_("Shutter Time")) ); diff --git a/synfig-core/trunk/src/synfig/target.cpp b/synfig-core/trunk/src/synfig/target.cpp index 988ac22..aa4b6f9 100644 --- a/synfig-core/trunk/src/synfig/target.cpp +++ b/synfig-core/trunk/src/synfig/target.cpp @@ -89,7 +89,8 @@ Target::ext_book() Target::Target(): quality_(4), gamma_(*default_gamma_), - remove_alpha(false) + remove_alpha(false), + avoid_time_sync_(false) { } diff --git a/synfig-core/trunk/src/tool/main.cpp b/synfig-core/trunk/src/tool/main.cpp index eb609c5..c37a2b7 100644 --- a/synfig-core/trunk/src/tool/main.cpp +++ b/synfig-core/trunk/src/tool/main.cpp @@ -67,7 +67,8 @@ enum exit_code SYNFIGTOOL_INVALIDTARGET =6, SYNFIGTOOL_RENDERFAILURE =7, SYNFIGTOOL_BLANK =8, - SYNFIGTOOL_BADVERSION =9 + SYNFIGTOOL_BADVERSION =9, + SYNFIGTOOL_MISSINGARGUMENT =10 }; #ifndef VERSION @@ -565,6 +566,10 @@ int extract_arg_cluster(arg_list_t &arg_list,arg_list_t &cluster) cluster.push_back(*iter); arg_list.erase(iter); iter=next++; + if (iter==arg_list.end()) { + error("The `%s' flag requires a value. Use --help for a list of options.", cluster.back().c_str()); + return SYNFIGTOOL_MISSINGARGUMENT; + } } cluster.push_back(*iter); @@ -588,14 +593,14 @@ int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc) w=atoi(iter->c_str()); arg_list.erase(iter); } - if(*iter=="-h") + else if(*iter=="-h") { arg_list.erase(iter); iter=next++; h=atoi(iter->c_str()); arg_list.erase(iter); } - if(*iter=="-a") + else if(*iter=="-a") { int a; arg_list.erase(iter); @@ -605,7 +610,7 @@ int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc) VERBOSE_OUT(1)<show(); + bline_width_refresh(); widget_bline_width->set_digits(2); widget_bline_width->set_size_request(24,-1); widget_bline_width->signal_value_changed().connect(sigc::mem_fun(*this,&studio::Widget_Defaults::on_bline_width_changed)); @@ -314,7 +315,6 @@ Widget_Defaults::Widget_Defaults() fg_color_refresh(); bg_color_refresh(); gradient_refresh(); - bline_width_refresh(); blend_method_refresh(); opacity_refresh(); interpolation_refresh(); diff --git a/synfig-studio/trunk/src/gtkmm/widget_distance.cpp b/synfig-studio/trunk/src/gtkmm/widget_distance.cpp index 081775a..ec16d7d 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_distance.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_distance.cpp @@ -57,6 +57,7 @@ using namespace studio; Widget_Distance::Widget_Distance(): Gtk::SpinButton(0.05,5), + distance_(1, Distance::SYSTEM_POINTS), adjustment(0,-100000000,100000000,1,1,1) // adjustment(0,-100000000,100000000,1,2,0) { diff --git a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp index b4d1135..9f8891a 100644 --- a/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp +++ b/synfig-studio/trunk/src/gtkmm/widget_timeslider.cpp @@ -316,6 +316,7 @@ Widget_Timeslider::Widget_Timeslider() adj_default(0,0,2,1/defaultfps,10/defaultfps), adj_timescale(0), //invalidated(false), +last_event_time(0), fps(defaultfps), dragscroll(false) { diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index ae5b909..1340f2a 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -625,6 +625,9 @@ WorkArea::WorkArea(etl::loose_handle canvas_interfac canvas(canvas_interface->get_canvas()), scrollx_adjustment(0,-4,4,0.01,0.1), scrolly_adjustment(0,-4,4,0.01,0.1), + w(128), + h(128), + last_event_time(0), progresscallback(0), dragging(DRAG_NONE), show_grid(false), diff --git a/synfig-studio/trunk/src/synfigapp/action.h b/synfig-studio/trunk/src/synfigapp/action.h index f010e3e..8ea4302 100644 --- a/synfig-studio/trunk/src/synfigapp/action.h +++ b/synfig-studio/trunk/src/synfigapp/action.h @@ -248,7 +248,7 @@ private: protected: CanvasSpecific(const synfig::Canvas::Handle &canvas):is_dirty_(true),mode_(MODE_UNDEFINED),canvas_(canvas) { } - CanvasSpecific():mode_(MODE_UNDEFINED) { } + CanvasSpecific():is_dirty_(true), mode_(MODE_UNDEFINED) { } virtual ~CanvasSpecific() { }; diff --git a/synfig-studio/trunk/src/synfigapp/cvs.cpp b/synfig-studio/trunk/src/synfigapp/cvs.cpp index a864c50..c1565ca 100644 --- a/synfig-studio/trunk/src/synfigapp/cvs.cpp +++ b/synfig-studio/trunk/src/synfigapp/cvs.cpp @@ -203,11 +203,11 @@ CVSInfo::in_repository()const bool CVSInfo::is_modified()const { + if(!in_sandbox() || !in_repository()) + return false; #ifdef _DEBUG synfig::info("%d-%d=%d",get_current_timestamp(),get_original_timestamp(),get_current_timestamp()-get_original_timestamp()); #endif - if(!in_sandbox() || !in_repository()) - return false; return get_current_timestamp()!=get_original_timestamp() && abs(get_current_timestamp()-get_original_timestamp())!=3600; }