From bdb0887facaf9cb16a7fcfab722cd83171fff8bd Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Fri, 22 Nov 2019 00:37:36 +0100 Subject: [PATCH] Fix some crashes. --- src/wx/film_viewer.cc | 3 +++ src/wx/gl_video_view.cc | 7 ++++--- src/wx/video_view.cc | 4 +++- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/wx/film_viewer.cc b/src/wx/film_viewer.cc index c7b32ff26..f921f83bd 100644 --- a/src/wx/film_viewer.cc +++ b/src/wx/film_viewer.cc @@ -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()); } diff --git a/src/wx/gl_video_view.cc b/src/wx/gl_video_view.cc index 2da16f1df..bfc611d37 100644 --- a/src/wx/gl_video_view.cc +++ b/src/wx/gl_video_view.cc @@ -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 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); diff --git a/src/wx/video_view.cc b/src/wx/video_view.cc index 7e9e1a947..7f93f765e 100644 --- a/src/wx/video_view.cc +++ b/src/wx/video_view.cc @@ -60,7 +60,9 @@ VideoView::get_next_frame (bool non_blocking) } shared_ptr butler = _viewer->butler (); - DCPOMATIC_ASSERT (butler); + if (!butler) { + return false; + } add_get (); boost::mutex::scoped_lock lm (_mutex); -- 2.30.2