From 171af7cda94675010ecd3586c5aebbfd1363f3fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Vondru=C5=A1?= Date: Wed, 19 Feb 2014 20:25:23 +0100 Subject: [PATCH] Be more defensive in getting max texture slot count. --- src/Magnum/Implementation/TextureState.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Magnum/Implementation/TextureState.cpp b/src/Magnum/Implementation/TextureState.cpp index 5b9988bb4..ba4022e55 100644 --- a/src/Magnum/Implementation/TextureState.cpp +++ b/src/Magnum/Implementation/TextureState.cpp @@ -34,7 +34,7 @@ namespace Magnum { namespace Implementation { -TextureState::TextureState(Context& context, std::vector& extensions): maxMaxAnisotropy(0.0f), currentLayer(0) +TextureState::TextureState(Context& context, std::vector& extensions): maxLayers(0), maxMaxAnisotropy(0.0f), currentLayer(0) #ifndef MAGNUM_TARGET_GLES , maxColorSamples(0), maxDepthSamples(0), maxIntegerSamples(0), bufferOffsetAlignment(0) #endif @@ -160,6 +160,7 @@ TextureState::TextureState(Context& context, std::vector& extension /* Resize bindings array to hold all possible layers */ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxLayers); + CORRADE_INTERNAL_ASSERT(maxLayers > 0); bindings.resize(maxLayers); }