Fix crash due to player_video().first becoming null sometime between
authorCarl Hetherington <cth@carlh.net>
Mon, 1 Jan 2024 23:15:47 +0000 (00:15 +0100)
committerCarl Hetherington <cth@carlh.net>
Mon, 1 Jan 2024 23:15:47 +0000 (00:15 +0100)
it being passed into the method and then being re-read via
another call to player_video().

src/wx/gl_video_view.cc

index 397693f51f1fbd7afe26a5fb796f788e60488564..06c9f268b5ef4abe37476e2394c82d7a43edd499 100644 (file)
@@ -621,9 +621,9 @@ GLVideoView::set_image (shared_ptr<const PlayerVideo> pv)
        auto const canvas_size = _canvas_size.load();
        int const canvas_width = canvas_size.GetWidth();
        int const canvas_height = canvas_size.GetHeight();
-       auto const inter_position = player_video().first->inter_position();
-       auto const inter_size = player_video().first->inter_size();
-       auto const out_size = player_video().first->out_size();
+       auto const inter_position = pv->inter_position();
+       auto const inter_size = pv->inter_size();
+       auto const out_size = pv->out_size();
        auto const crop_guess = _viewer->crop_guess();
 
        auto x_offset = std::max(0, (canvas_width - out_size.width) / 2);