From cd04784c335df046dd2f8f22faf846595eb8b250 Mon Sep 17 00:00:00 2001 From: Luke Benstead Date: Thu, 28 Mar 2019 13:05:13 +0000 Subject: [PATCH] Fix memory corruption --- GL/draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/GL/draw.c b/GL/draw.c index 319f095..c008fb1 100644 --- a/GL/draw.c +++ b/GL/draw.c @@ -505,7 +505,7 @@ Vertex* _glSubmissionTargetEnd(SubmissionTarget* target) { static inline void genTriangles(Vertex* output, GLuint count) { Vertex* it = output + 2; - ITERATE(count) { + ITERATE(count / 3) { it->flags = PVR_CMD_VERTEX_EOL; it += 3; } @@ -513,9 +513,9 @@ static inline void genTriangles(Vertex* output, GLuint count) { static inline void genQuads(Vertex* output, GLuint count) { Vertex* this = output + 2; - Vertex* next = this + 1; + Vertex* next = output + 3; - ITERATE(count) { + ITERATE(count / 4) { swapVertex(this, next); next->flags = PVR_CMD_VERTEX_EOL;