From 3376ad65688f6c5118edf85f220b0293eadfb894 Mon Sep 17 00:00:00 2001 From: "@clasher113" Date: Tue, 10 Sep 2024 14:35:47 +0300 Subject: [PATCH] Batch3D::point() check buffer overflow --- src/graphics/core/Batch3D.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/graphics/core/Batch3D.cpp b/src/graphics/core/Batch3D.cpp index 82bc3bc3..4f32ae3e 100644 --- a/src/graphics/core/Batch3D.cpp +++ b/src/graphics/core/Batch3D.cpp @@ -246,6 +246,9 @@ void Batch3D::blockCube( } void Batch3D::point(glm::vec3 coord, glm::vec2 uv, glm::vec4 tint) { + if (index + B3D_VERTEX_SIZE >= capacity) { + flush(); + } vertex(coord, uv, tint.r, tint.g, tint.b, tint.a); }