From 16576552d24055804529c6f7a6b04518b781e0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 16 Dec 2015 11:33:57 +0100 Subject: [PATCH] Initialize GL object label size to 0 to prevent uninit mem access. On AMD drivers the debug output has to be explicitly enabled on context creation, otherwise all debug functions are no-op, thus causing the functions to read uninitialized memory. --- src/Magnum/AbstractObject.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Magnum/AbstractObject.cpp b/src/Magnum/AbstractObject.cpp index a50bc0345..a9ff8c2f9 100644 --- a/src/Magnum/AbstractObject.cpp +++ b/src/Magnum/AbstractObject.cpp @@ -161,7 +161,7 @@ std::string AbstractObject::getLabelImplementationNoOp(GLenum, GLuint) { return std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, const GLuint name) { /* Get label size (w/o null terminator). Specifying 0 as size is not allowed, thus we pass the maximum instead. */ - GLsizei size; + GLsizei size = 0; #ifndef MAGNUM_TARGET_GLES glGetObjectLabel(identifier, name, maxLabelLength(), &size, nullptr); #elif !defined(CORRADE_TARGET_NACL) @@ -189,7 +189,7 @@ std::string AbstractObject::getLabelImplementationKhr(const GLenum identifier, c } std::string AbstractObject::getLabelImplementationExt(const GLenum identifier, const GLuint name) { - GLsizei size; + GLsizei size = 0; /* Get label size (w/o null terminator) */ #ifndef CORRADE_TARGET_NACL