summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llrender/llimagegl.cpp15
-rw-r--r--indra/newview/llviewerdisplay.cpp5
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index d873005fd9..cd493481d5 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1736,12 +1736,25 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
if (u < 0.f || u > 1.f ||
v < 0.f || v > 1.f)
{
- llerrs << "WTF?" << llendl;
+ LL_WARNS_ONCE("render") << "Ugh, u/v out of range in image mask pick" << LL_ENDL;
+ u = v = 0.f;
+ llassert(false);
}
S32 x = (S32)(u * width);
S32 y = (S32)(v * height);
+ if (x >= width)
+ {
+ LL_WARNS_ONCE("render") << "Ooh, width overrun on pick mask read, that coulda been bad." << LL_ENDL;
+ x = llmax(0, width-1);
+ }
+ if (y >= height)
+ {
+ LL_WARNS_ONCE("render") << "Ooh, height overrun on pick mask read, that woulda been bad." << LL_ENDL;
+ y = llmax(0, height-1);
+ }
+
S32 idx = y*width+x;
S32 offset = idx%8;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index 7b9b12108d..ba256d70e8 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -483,7 +483,6 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot)
{
LLAppViewer::instance()->pingMainloopTimeout("Display:Disconnected");
render_ui();
- render_disconnected_background();
}
//////////////////////////
@@ -1141,6 +1140,10 @@ void render_ui(F32 zoom_factor, int subfield)
render_ui_3d();
LLGLState::checkStates();
}
+ else
+ {
+ render_disconnected_background();
+ }
render_ui_2d();
LLGLState::checkStates();