diff options
author | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-31 21:24:04 +0300 |
---|---|---|
committer | andreykproductengine <andreykproductengine@lindenlab.com> | 2017-05-31 21:24:04 +0300 |
commit | 19c3f47e00e348739eaf31685c8ea804704a08e5 (patch) | |
tree | b5e95cdcdf728c68d91a3fc42c25e74a30ff85b9 /indra | |
parent | 8c393b49930d695529ffee48864bb5aae5e71693 (diff) |
MAINT-7325 Fixed issue of images being marked as missing due to uninitialized discard level
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llviewertexture.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 6abd6f7b64..c162af371f 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1462,9 +1462,17 @@ BOOL LLViewerFetchedTexture::createTexture(S32 usename/*= 0*/) } bool size_okay = true; - - U32 raw_width = mRawImage->getWidth() << mRawDiscardLevel; - U32 raw_height = mRawImage->getHeight() << mRawDiscardLevel; + + S32 discard_level = mRawDiscardLevel; + if (mRawDiscardLevel < 0) + { + LL_DEBUGS() << "Negative raw discard level when creating image: " << mRawDiscardLevel << LL_ENDL; + discard_level = 0; + } + + U32 raw_width = mRawImage->getWidth() << discard_level; + U32 raw_height = mRawImage->getHeight() << discard_level; + if( raw_width > MAX_IMAGE_SIZE || raw_height > MAX_IMAGE_SIZE ) { LL_INFOS() << "Width or height is greater than " << MAX_IMAGE_SIZE << ": (" << raw_width << "," << raw_height << ")" << LL_ENDL; |