Fix crash when resizing a track quickly.
authorDavid Robillard <d@drobilla.net>
Sat, 6 Dec 2014 22:46:12 +0000 (17:46 -0500)
committerDavid Robillard <d@drobilla.net>
Sun, 7 Dec 2014 03:43:06 +0000 (22:43 -0500)
Triggered by resize drag an automation track very quickly upwards to shrink it
to the minimum.  Caused by unsigned integer underflow.

gtk2_ardour/time_axis_view.cc
gtk2_ardour/time_axis_view.h

index 58969a97f5c5f90bd94a718a60abe79c324199da..9cba0bbac3ef05c01cd2462968c900f51e661323 100644 (file)
@@ -406,9 +406,9 @@ TimeAxisView::controls_ebox_button_press (GdkEventButton* event)
 }
 
 void
-TimeAxisView::idle_resize (uint32_t h)
+TimeAxisView::idle_resize (int32_t h)
 {
-       set_height (h);
+       set_height (std::max(0, h));
 }
 
 
index 6dc02110c2193e4120fbe73c2a6e1fe2dd089e4d..ab990f875acf9bcc2bb62931493cdd9807d47e27 100644 (file)
@@ -124,7 +124,7 @@ class TimeAxisView : public virtual AxisView
 
        uint32_t current_height() const { return height; }
 
-       void idle_resize (uint32_t);
+       void idle_resize (int32_t);
 
        virtual guint32 show_at (double y, int& nth, Gtk::VBox *parent);
        virtual void hide ();