aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/llviewerimage.cpp22
1 files changed, 18 insertions, 4 deletions
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index 5a042f2..ca8ed26 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -398,20 +398,34 @@ BOOL LLViewerImage::createTexture(S32 usename/*= 0*/)
398 mOrigHeight = mFullHeight; 398 mOrigHeight = mFullHeight;
399 } 399 }
400 400
401 401 bool size_okay = true;
402 if (LLImageGL::checkSize(mRawImage->getWidth(), mRawImage->getHeight())) 402
403 U32 raw_width = mRawImage->getWidth() << mRawDiscardLevel;
404 U32 raw_height = mRawImage->getHeight() << mRawDiscardLevel;
405 if( raw_width > MAX_IMAGE_SIZE || raw_height > MAX_IMAGE_SIZE )
403 { 406 {
404 res = LLImageGL::createGLTexture(mRawDiscardLevel, mRawImage, usename); 407 llinfos << "Width or height is greater than " << MAX_IMAGE_SIZE << ": (" << raw_width << "," << raw_height << ")" << llendl;
408 size_okay = false;
405 } 409 }
406 else 410
411 if (!LLImageGL::checkSize(mRawImage->getWidth(), mRawImage->getHeight()))
407 { 412 {
408 // A non power-of-two image was uploaded (through a non standard client) 413 // A non power-of-two image was uploaded (through a non standard client)
414 llinfos << "Non power of two width or height: (" << mRawImage->getWidth() << "," << mRawImage->getHeight() << ")" << llendl;
415 size_okay = false;
416 }
417
418 if( !size_okay )
419 {
420 // An inappropriately-sized image was uploaded (through a non standard client)
409 // We treat these images as missing assets which causes them to 421 // We treat these images as missing assets which causes them to
410 // be renderd as 'missing image' and to stop requesting data 422 // be renderd as 'missing image' and to stop requesting data
411 setIsMissingAsset(); 423 setIsMissingAsset();
412 destroyRawImage(); 424 destroyRawImage();
413 return FALSE; 425 return FALSE;
414 } 426 }
427
428 res = LLImageGL::createGLTexture(mRawDiscardLevel, mRawImage, usename);
415 } 429 }
416 430
417 // 431 //