From 7bdae66027bf815e0ccd80f890e2e21afe6a82fb Mon Sep 17 00:00:00 2001 From: bkaradzic Date: Thu, 15 Aug 2013 00:06:10 -0700 Subject: [PATCH] GL: Fixed memory corruption. --- src/renderer_gl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 25bf1d9e4..5efdb43dc 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -548,7 +548,7 @@ namespace bgfx { GL_CHECK(glGenFramebuffers(1, &m_msaaBackBufferFbo) ); GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_msaaBackBufferFbo) ); - GL_CHECK(glGenRenderbuffers(3, m_msaaBackBufferRbos) ); + GL_CHECK(glGenRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) ); GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[0]) ); GL_CHECK(glRenderbufferStorageMultisample(GL_RENDERBUFFER, _msaa, GL_RGBA8, _width, _height) ); GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[1]) ); @@ -576,7 +576,7 @@ namespace bgfx if (0 != m_msaaBackBufferFbo) { GL_CHECK(glDeleteFramebuffers(1, &m_msaaBackBufferFbo) ); - GL_CHECK(glDeleteRenderbuffers(3, m_msaaBackBufferRbos) ); + GL_CHECK(glDeleteRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) ); m_msaaBackBufferFbo = 0; } #endif // BGFX_CONFIG_RENDERER_OPENGL|BGFX_CONFIG_RENDERER_OPENGLES3