Fix some crashes.
authorCarl Hetherington <cth@carlh.net>
Thu, 21 Nov 2019 23:37:36 +0000 (00:37 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 8 Jan 2020 20:56:47 +0000 (21:56 +0100)
src/wx/film_viewer.cc
src/wx/gl_video_view.cc
src/wx/video_view.cc

index c7b32ff..f921f83 100644 (file)
@@ -406,6 +406,9 @@ FilmViewer::slow_refresh ()
 bool
 FilmViewer::quick_refresh ()
 {
+       if (!_video_view || !_film) {
+               return true;
+       }
        return _video_view->refresh_metadata (_film, _player->video_container_size(), _film->frame_size());
 }
 
index 2da16f1..bfc611d 100644 (file)
@@ -325,9 +325,10 @@ try
                        }
 
                        get_next_frame (false);
-                       set_image (player_video().first->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
-                       inter_position = player_video().first->inter_position();
-                       inter_size = player_video().first->inter_size();
+                       shared_ptr<PlayerVideo> pv = player_video().first;
+                       set_image (pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), false, true));
+                       inter_position = pv->inter_position();
+                       inter_size = pv->inter_size();
                }
                draw (inter_position, inter_size);
 
index 7e9e1a9..7f93f76 100644 (file)
@@ -60,7 +60,9 @@ VideoView::get_next_frame (bool non_blocking)
        }
 
        shared_ptr<Butler> butler = _viewer->butler ();
-       DCPOMATIC_ASSERT (butler);
+       if (!butler) {
+               return false;
+       }
        add_get ();
 
        boost::mutex::scoped_lock lm (_mutex);