# SDL: testgles2: Fix buffer object sizes

**URL:** <https://discourse.libsdl.org/t/sdl-testgles2-fix-buffer-object-sizes/35262>\
**Category:** SDL Commits\
**Created:** [April 5, 2022, 5:06pm UTC](https://discourse.libsdl.org/t/sdl-testgles2-fix-buffer-object-sizes/35262 "2022-04-05T17:06:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SDLPushPostBot](https://discourse.libsdl.org/user_avatar/discourse.libsdl.org/sdlpushpostbot/32/4370_2.png) [@SDLPushPostBot](https://discourse.libsdl.org/u/SDLPushPostBot)\
**Post date:** [April 5, 2022, 5:06pm UTC](https://discourse.libsdl.org/t/sdl-testgles2-fix-buffer-object-sizes/35262/1 "2022-04-05T17:06:02Z")

</div>

> <https://github.com/libsdl-org/SDL/commit/006a5a9e03e60471688186ac02524de85009fef6>

```diff
From 006a5a9e03e60471688186ac02524de85009fef6 Mon Sep 17 00:00:00 2001
From: capehill <[EMAIL REDACTED]>
Date: Mon, 28 Mar 2022 21:01:06 +0300
Subject: [PATCH] testgles2: Fix buffer object sizes

---
 test/testgles2.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/test/testgles2.c b/test/testgles2.c
index 2000e01ec9c..c42835ebb4c 100644
--- a/test/testgles2.c
+++ b/test/testgles2.c
@@ -712,13 +712,13 @@ main(int argc, char *argv[])
 
         GL_CHECK(ctx.glGenBuffers(1, &data->position_buffer));
         GL_CHECK(ctx.glBindBuffer(GL_ARRAY_BUFFER, data->position_buffer));
- GL_CHECK(ctx.glBufferData(GL_ARRAY_BUFFER, sizeof(_vertices) * 4, _vertices, GL_STATIC_DRAW));
+ GL_CHECK(ctx.glBufferData(GL_ARRAY_BUFFER, sizeof(_vertices), _vertices, GL_STATIC_DRAW));
         GL_CHECK(ctx.glVertexAttribPointer(data->attr_position, 3, GL_FLOAT, GL_FALSE, 0, 0));
         GL_CHECK(ctx.glBindBuffer(GL_ARRAY_BUFFER, 0));
 
         GL_CHECK(ctx.glGenBuffers(1, &data->color_buffer));
         GL_CHECK(ctx.glBindBuffer(GL_ARRAY_BUFFER, data->color_buffer));
- GL_CHECK(ctx.glBufferData(GL_ARRAY_BUFFER, sizeof(_colors) * 4, _colors, GL_STATIC_DRAW));
+ GL_CHECK(ctx.glBufferData(GL_ARRAY_BUFFER, sizeof(_colors), _colors, GL_STATIC_DRAW));
         GL_CHECK(ctx.glVertexAttribPointer(data->attr_color, 3, GL_FLOAT, GL_FALSE, 0, 0));
         GL_CHECK(ctx.glBindBuffer(GL_ARRAY_BUFFER, 0));
 

```
