Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Fixed bug 1403 - Creating a window with resizable flags may crash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
slouken committed Feb 4, 2012
1 parent 76f21eb commit ea52603
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/video/x11/SDL_x11window.c
Expand Up @@ -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;
Expand Down

0 comments on commit ea52603

Please sign in to comment.