From 3009fd75749e9bfe7ef3748eb94226b53cbbe264 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 23 Nov 2017 10:38:05 +0100 Subject: [PATCH] Fix a potential(?) nullptr dereference --- gtk2_ardour/fft_graph.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/fft_graph.cc b/gtk2_ardour/fft_graph.cc index 27d5b06f3e..25f6c6ff29 100644 --- a/gtk2_ardour/fft_graph.cc +++ b/gtk2_ardour/fft_graph.cc @@ -420,8 +420,6 @@ FFTGraph::draw_scales (cairo_t* cr) void FFTGraph::redraw () { - Glib::Threads::Mutex::Lock lm (_a_window->track_list_lock); - assert (_surface); cairo_t* cr = cairo_create (_surface); @@ -433,6 +431,8 @@ FFTGraph::redraw () return; } + Glib::Threads::Mutex::Lock lm (_a_window->track_list_lock); + if (!_a_window->track_list_ready) { cairo_destroy (cr); queue_draw ();