Skip to content

Commit

Permalink
Fixed bug 3541 - DisplayIndex out of bounds in SDL_SetWindowPosition
Browse files Browse the repository at this point in the history
Intellectual Kitty

In SDL_video.c, on line #1756, in SDL_SetWindowPosition (from today's distribution, 12-31-2016, https://hg.libsdl.org/SDL/shortlog/bf19e0c84483):

        if (displayIndex > _this->num_displays) {

should be:

        if (displayIndex >= _this->num_displays) {
  • Loading branch information
slouken committed Dec 31, 2016
1 parent e61daa7 commit 7f2068d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/video/SDL_video.c
Expand Up @@ -1753,7 +1753,7 @@ SDL_SetWindowPosition(SDL_Window * window, int x, int y)
if (SDL_WINDOWPOS_ISCENTERED(x) || SDL_WINDOWPOS_ISCENTERED(y)) {
int displayIndex = (x & 0xFFFF);
SDL_Rect bounds;
if (displayIndex > _this->num_displays) {
if (displayIndex >= _this->num_displays) {
displayIndex = 0;
}

Expand Down

0 comments on commit 7f2068d

Please sign in to comment.