Fix corrupted image (and probably crashes) when changing the player's
authorCarl Hetherington <cth@carlh.net>
Sun, 18 Mar 2018 23:43:49 +0000 (23:43 +0000)
committerCarl Hetherington <cth@carlh.net>
Sun, 18 Mar 2018 23:43:49 +0000 (23:43 +0000)
window size; we request images of the new size with set_video_container_size
but some old ones from the butler (I think) will arrive.  Check that the
images are the right size before we try to construct a wxBitmap with them.
Should fix #1242.

src/wx/film_viewer.cc

index ade45d766879ab4030f5dfcdc80fc9ea6b462535..1103db159f5a5c2bdd1a98d8339c86cd4d056509 100644 (file)
@@ -373,7 +373,7 @@ FilmViewer::paint_panel ()
 {
        wxPaintDC dc (_panel);
 
-       if (!_frame || !_film || !_out_size.width || !_out_size.height) {
+       if (!_frame || !_film || !_out_size.width || !_out_size.height || _out_size != _frame->size()) {
                dc.Clear ();
                return;
        }