Fix GTK warning on startup.
authorCarl Hetherington <cth@carlh.net>
Tue, 16 Oct 2012 12:17:36 +0000 (13:17 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 16 Oct 2012 12:17:36 +0000 (13:17 +0100)
src/wx/film_viewer.cc

index c42ffaeebeb348f8d4a6068ecabf92e92620225f..6c8f38cfcdb784072cf3de2046c4a66f31ffa87a 100644 (file)
@@ -232,8 +232,8 @@ FilmViewer::FilmViewer (Film* f, wxWindow* p)
        _thumb_panel = new ThumbPanel (this, f);
        _sizer->Add (_thumb_panel, 1, wxEXPAND);
 
-       int const max = f ? f->num_thumbs() - 1 : 0;
-       _slider = new wxSlider (this, wxID_ANY, 0, 0, max);
+       int const m = max (1, f ? f->num_thumbs() - 1 : 0);
+       _slider = new wxSlider (this, wxID_ANY, 0, 0, m);
        _sizer->Add (_slider, 0, wxEXPAND | wxLEFT | wxRIGHT);
        set_thumbnail (0);