From 83600bb16ac305542de9bb9fd8eba1bec90dc1b0 Mon Sep 17 00:00:00 2001 From: Mnikolenko Productengine Date: Tue, 20 Oct 2020 14:25:54 +0300 Subject: SL-14108 FIXED Viewer crashes immediately after login --- indra/llrender/llimagegl.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 3b6a49735e..c85b9a890a 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1386,6 +1386,15 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S return FALSE; } + if (mHasExplicitFormat && + (mFormatPrimary == GL_RGBA && mComponents < 4) || + (mFormatPrimary == GL_RGB && mComponents < 3)) + + { + LL_WARNS() << "Incorrect format: " << std::hex << mFormatPrimary << " components: " << (U32)mComponents << LL_ENDL; + mHasExplicitFormat = FALSE; + } + if( !mHasExplicitFormat ) { switch (mComponents) -- cgit v1.2.3