diff --git a/src/win/win_opengl.c b/src/win/win_opengl.c index 141dd8450..8a181a4c3 100644 --- a/src/win/win_opengl.c +++ b/src/win/win_opengl.c @@ -626,7 +626,7 @@ static void opengl_main(void* param) } /* Clip to height. y2 can be out-of-bounds. */ - int sub_height = MIN(info->y2 - info->y1, info->h - info->y1); + int sub_height = MIN(info->y2, info->h) - info->y1; if (!GLAD_GL_ARB_buffer_storage) {