From 72660a51dd685d64c9227e9ae10e854ba58b6e17 Mon Sep 17 00:00:00 2001 From: Sylvain Becker Date: Sun, 13 Oct 2019 20:52:52 +0200 Subject: [PATCH] Fixed bug 4825 - SDL Renderer OpenGL: Buffer overflow (SDL_RENDERCMD_DRAW_LINES) --- src/render/opengl/SDL_render_gl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index d3ad24f05..06f69b444 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1210,6 +1210,7 @@ GL_RunCommandQueue(SDL_Renderer * renderer, SDL_RenderCommand *cmd, void *vertic data->glVertex2f(verts[0], verts[1]); } data->glEnd(); + verts -= 2 * count; /* The line is half open, so we need one more point to complete it. * http://www.opengl.org/documentation/specs/version1.1/glspec1.1/node47.html