From 7f2068dacac3f125d2a47e36e14eedc599fa5e83 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 31 Dec 2016 10:30:07 -0800 Subject: [PATCH] Fixed bug 3541 - DisplayIndex out of bounds in SDL_SetWindowPosition 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) { --- src/video/SDL_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 508aed901becb..ad0ec766a3fef 100644 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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; }