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); }