From 870a435cb67285cc8e94dab47ff0b95d44d2e273 Mon Sep 17 00:00:00 2001 From: David Capello Date: Tue, 29 Apr 2014 00:51:08 -0300 Subject: [PATCH] Timeline: fix crash when we remove all layers (issue #393) --- src/app/ui/timeline.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/ui/timeline.cpp b/src/app/ui/timeline.cpp index beebb766e..5eae7b870 100644 --- a/src/app/ui/timeline.cpp +++ b/src/app/ui/timeline.cpp @@ -1000,6 +1000,9 @@ void Timeline::getDrawableLayers(ui::Graphics* g, int* first_layer, int* last_la *first_layer = MID(0, *first_layer, (int)m_layers.size()-1); *last_layer = *first_layer + (getClientBounds().h - HDRSIZE) / LAYSIZE; *last_layer = MID(0, *last_layer, (int)m_layers.size()-1); + + if (m_layers.empty()) + *last_layer = -1; } void Timeline::getDrawableFrames(ui::Graphics* g, FrameNumber* first_frame, FrameNumber* last_frame)