aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerimage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewerimage.cpp')
-rw-r--r--linden/indra/newview/llviewerimage.cpp29
1 files changed, 25 insertions, 4 deletions
diff --git a/linden/indra/newview/llviewerimage.cpp b/linden/indra/newview/llviewerimage.cpp
index 3a14bf0..62539a6 100644
--- a/linden/indra/newview/llviewerimage.cpp
+++ b/linden/indra/newview/llviewerimage.cpp
@@ -776,6 +776,10 @@ void LLViewerImage::switchToCachedImage()
776 // We've changed the number of components, so we need to move any 776 // We've changed the number of components, so we need to move any
777 // objects using this pool to a different pool. 777 // objects using this pool to a different pool.
778 mComponents = mRawImage->getComponents(); 778 mComponents = mRawImage->getComponents();
779 if ((U32)mComponents > 4)
780 {
781 LL_DEBUGS("Openjpeg") << "Bad number of components for mRawImage: " << (U32)mComponents << "!" << llendl;
782 }
779 gImageList.dirtyImage(this); 783 gImageList.dirtyImage(this);
780 } 784 }
781 785
@@ -1054,10 +1058,27 @@ bool LLViewerImage::updateFetch()
1054 { 1058 {
1055 if (getComponents() != mRawImage->getComponents()) 1059 if (getComponents() != mRawImage->getComponents())
1056 { 1060 {
1057 // We've changed the number of components, so we need to move any 1061 // Do a quick sanity check to make sure we can actually
1058 // objects using this pool to a different pool. 1062 // use the right number of components here -- MC
1059 mComponents = mRawImage->getComponents(); 1063 if ((U32)mRawImage->getComponents() > 4)
1060 gImageList.dirtyImage(this); 1064 {
1065 LL_DEBUGS("Openjpeg") << "Bad number of components for mRawImage->getComponents(): " << (U32)mRawImage->getComponents() << "! Stopping fetching of the texture" << llendl;
1066
1067 destroyRawImage();
1068 setIsMissingAsset();
1069 mRawDiscardLevel = INVALID_DISCARD_LEVEL ;
1070 mIsFetching = FALSE ;
1071 gImageList.deleteImage(this);
1072
1073 return FALSE;
1074 }
1075 else
1076 {
1077 // We've changed the number of components, so we need to move any
1078 // objects using this pool to a different pool.
1079 mComponents = mRawImage->getComponents();
1080 gImageList.dirtyImage(this);
1081 }
1061 } 1082 }
1062 1083
1063 mFullWidth = mRawImage->getWidth() << mRawDiscardLevel; 1084 mFullWidth = mRawImage->getWidth() << mRawDiscardLevel;