From a2b9a65b8f8e16b14f1c36e348cac4c1e9a06347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Fri, 11 Oct 2013 00:48:04 +0200 Subject: [PATCH] Fixed segfault in AbstractTexture::bind(). Caused in 6ee2745503bf056185f111d6faeb1f2491210af6, I accidentaly removed code that initialized the array to proper length. Again I experienced how useful unit tests for GL functionality would be. --- src/AbstractTexture.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/AbstractTexture.cpp b/src/AbstractTexture.cpp index 5881b7c6c..a49539ca4 100644 --- a/src/AbstractTexture.cpp +++ b/src/AbstractTexture.cpp @@ -233,6 +233,9 @@ void AbstractTexture::bindInternal() { } void AbstractTexture::initializeContextBasedFunctionality(Context& context) { + /* Resize bindings array to hold all possible layers */ + context.state().texture->bindings.resize(maxLayers()); + #ifndef MAGNUM_TARGET_GLES if(context.isExtensionSupported()) { Debug() << "AbstractTexture: using" << Extensions::GL::EXT::direct_state_access::string() << "features";