From 09bd88c9df88a070a2cd98a223668c23333142a1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 6 Dec 2014 17:46:12 -0500 Subject: [PATCH] Fix crash when resizing a track quickly. 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 | 4 ++-- gtk2_ardour/time_axis_view.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/time_axis_view.cc b/gtk2_ardour/time_axis_view.cc index 58969a97f5..9cba0bbac3 100644 --- a/gtk2_ardour/time_axis_view.cc +++ b/gtk2_ardour/time_axis_view.cc @@ -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)); } diff --git a/gtk2_ardour/time_axis_view.h b/gtk2_ardour/time_axis_view.h index 6dc02110c2..ab990f875a 100644 --- a/gtk2_ardour/time_axis_view.h +++ b/gtk2_ardour/time_axis_view.h @@ -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 ();