[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 23/53] sdl2: fix crash in handle_windowevent() when
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 23/53] sdl2: fix crash in handle_windowevent() when restoring the screen size |
Date: |
Thu, 30 Jul 2015 06:32:38 -0500 |
From: Alberto Garcia <address@hidden>
The Ctrl-Alt-u keyboard shortcut restores the screen to its original
size. In the SDL2 UI this is done by destroying the window and
creating a new one. The old window emits SDL_WINDOWEVENT_HIDDEN when
it's destroyed, but trying to call SDL_GetWindowFromID() from that
event's window ID returns a null pointer. handle_windowevent() assumes
that the pointer is never null so it results in a crash.
Cc: address@hidden
Signed-off-by: Alberto Garcia <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
(cherry picked from commit 08d49df0dbaacc220a099dbfb644e1dc0eda57be)
Signed-off-by: Michael Roth <address@hidden>
---
ui/sdl2.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 60e3c3b..f10c6a4 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -511,6 +511,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:
{
--
1.9.1
- [Qemu-devel] [PATCH 13/53] block: Fix NULL deference for unaligned write if qiov is NULL, (continued)
- [Qemu-devel] [PATCH 13/53] block: Fix NULL deference for unaligned write if qiov is NULL, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 15/53] hw/acpi/aml-build: Fix memory leak, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 16/53] qga/commands-posix: Fix bug in guest-fstrim, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 18/53] kbd: add brazil kbd keys to x11 evdev map, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 14/53] qemu-iotests: Test unaligned sub-block zero write, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 17/53] kbd: add brazil kbd keys to qemu, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 20/53] iotests: qcow2 COW with minimal L2 cache size, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 01/53] bt-sdp: fix broken uuids power-of-2 calculation, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 19/53] qcow2: Set MIN_L2_CACHE_SIZE to 2, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 21/53] vmdk: Fix index_in_cluster calculation in vmdk_co_get_block_status, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 23/53] sdl2: fix crash in handle_windowevent() when restoring the screen size,
Michael Roth <=
- [Qemu-devel] [PATCH 22/53] vmdk: Use vmdk_find_index_in_cluster everywhere, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 25/53] i8254: fix out-of-bounds memory access in pit_ioport_read(), Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 24/53] spice-display: fix segfault in qemu_spice_create_update, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 26/53] hw/core: rebase sysbus_get_fw_dev_path() to g_strdup_printf(), Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 27/53] vhost: correctly pass error to caller in vhost_dev_enable_notifiers(), Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 28/53] virtio-ccw: complete handling of guest-initiated resets, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 29/53] block: Add bdrv_get_block_status_above, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 32/53] block: Fix dirty bitmap in bdrv_co_discard, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 34/53] qemu-iotests: Add test case for mirror with unmap, Michael Roth, 2015/07/30
- [Qemu-devel] [PATCH 31/53] mirror: Do zero write on target if sectors not allocated, Michael Roth, 2015/07/30