From ea52603a1569a82e9ece0d72b73a5970fa4793e5 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Fri, 3 Feb 2012 22:24:33 -0500 Subject: [PATCH] Fixed bug 1403 - Creating a window with resizable flags may crash jordirovira 2012-01-28 12:07:39 PST in SDL_x11window around 520: /* Setup the normal size hints */ if (!(window->flags & SDL_WINDOW_RESIZABLE)) { sizehints.min_width = sizehints.max_width = window->w; sizehints.min_height = sizehints.max_height = window->h; sizehints.flags = PMaxSize | PMinSize; } sizehints.x = window->x; sizehints.y = window->y; sizehints.flags |= USPosition; the sizehints.flags member is not initizalised if it doesn't enter the conditional. It is as easy as setting it to zero before the conditional. --- src/video/x11/SDL_x11window.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/video/x11/SDL_x11window.c b/src/video/x11/SDL_x11window.c index 9a4e759d3..362c571ff 100755 --- a/src/video/x11/SDL_x11window.c +++ b/src/video/x11/SDL_x11window.c @@ -501,10 +501,11 @@ X11_CreateWindow(_THIS, SDL_Window * window) } /* Setup the normal size hints */ + sizehints.flags = 0; if (!(window->flags & SDL_WINDOW_RESIZABLE)) { sizehints.min_width = sizehints.max_width = window->w; sizehints.min_height = sizehints.max_height = window->h; - sizehints.flags = PMaxSize | PMinSize; + sizehints.flags |= (PMaxSize | PMinSize); } sizehints.x = window->x; sizehints.y = window->y;