Merge remote-tracking branch 'remotes/kraxel/tags/pull-sdl-20150611-1' into staging
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jun 2015 13:40:25 +0000 (14:40 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jun 2015 13:40:25 +0000 (14:40 +0100)
sdl2: fix crash in handle_windowevent() when restoring the screen size

# gpg: Signature made Thu Jun 11 08:57:38 2015 BST using RSA key ID D3E87138
# gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>"
# gpg:                 aka "Gerd Hoffmann <gerd@kraxel.org>"
# gpg:                 aka "Gerd Hoffmann (private) <kraxel@gmail.com>"

* remotes/kraxel/tags/pull-sdl-20150611-1:
  sdl2: fix crash in handle_windowevent() when restoring the screen size

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
ui/sdl2.c

index 2d60179..5cb75aa 100644 (file)
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -521,6 +521,10 @@ static void handle_windowevent(SDL_Event *ev)
 {
     struct sdl2_console *scon = get_scon_from_window(ev->window.windowID);
 
+    if (!scon) {
+        return;
+    }
+
     switch (ev->window.event) {
     case SDL_WINDOWEVENT_RESIZED:
         {