Check that get_next_frame succeeds.
authorCarl Hetherington <cth@carlh.net>
Fri, 22 Nov 2019 00:52:53 +0000 (01:52 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 8 Jan 2020 20:56:47 +0000 (21:56 +0100)
src/wx/gl_video_view.cc

index bfc611d..ddae9bb 100644 (file)
@@ -326,9 +326,11 @@ try
 
                        get_next_frame (false);
                        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();
+                       if (pv) {
+                               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);