From 85053e53b6ffabddf702f5ef8da52fe5c18e7753 Mon Sep 17 00:00:00 2001
From: Xiaohong Bao <bao@lindenlab.com>
Date: Fri, 10 Sep 2010 10:26:42 -0600
Subject: [PATCH] fix for VWR-22811: crash at
 LLImageGL::createGLTexture(int,unsigned char const *,int,int) [secondlife-bin
 llimagegl.cpp] line 1259

---
 indra/llrender/llrender.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index e26acd53a33..8eb160f4e78 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -431,6 +431,9 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio
 			if (gGL.mMaxAnisotropy < 1.f)
 			{
 				glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &gGL.mMaxAnisotropy);
+
+				llinfos << "gGL.mMaxAnisotropy: " << gGL.mMaxAnisotropy << llendl ;
+				gGL.mMaxAnisotropy = llmax(1.f, gGL.mMaxAnisotropy) ;
 			}
 			glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY_EXT, gGL.mMaxAnisotropy);
 		}
-- 
GitLab