summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2010-03-25 17:46:36 -0600
committerXiaohong Bao <bao@lindenlab.com>2010-03-25 17:46:36 -0600
commitfad31dc087cb670bd4479195cac2c31da9a55e57 (patch)
tree83e3cb702a00dce270e4b7755c6130b6661bcdb9 /indra/llrender
parent091e4c2bdc7fa9139437872e09886892f2a9f702 (diff)
parent6f179fc6aca66a8349ca608b34ea7707ff590519 (diff)
Automated merge with ssh://hg.lindenlab.com/q/viewer-trunk
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index 36ac3ff119..5edd6c8886 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1699,8 +1699,8 @@ void LLImageGL::updatePickMask(S32 width, S32 height, const U8* data_in)
U32 size = pick_width * pick_height;
size = (size + 7) / 8; // pixelcount-to-bits
mPickMask = new U8[size];
- mPickMaskWidth = pick_width;
- mPickMaskHeight = pick_height;
+ mPickMaskWidth = pick_width - 1;
+ mPickMaskHeight = pick_height - 1;
memset(mPickMask, 0, sizeof(U8) * size);
@@ -1743,20 +1743,20 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
llassert(false);
}
- llassert(mPickMaskWidth > 0 && mPickMaskHeight > 0);
+ llassert(mPickMaskWidth >= 0 && mPickMaskHeight >= 0);
S32 x = llfloor(u * mPickMaskWidth);
S32 y = llfloor(v * mPickMaskHeight);
- if (LL_UNLIKELY(x >= mPickMaskWidth))
+ if (LL_UNLIKELY(x > mPickMaskWidth))
{
LL_WARNS_ONCE("render") << "Ooh, width overrun on pick mask read, that coulda been bad." << LL_ENDL;
- x = llmax(0, mPickMaskWidth-1);
+ x = llmax((U16)0, mPickMaskWidth);
}
- if (LL_UNLIKELY(y >= mPickMaskHeight))
+ if (LL_UNLIKELY(y > mPickMaskHeight))
{
LL_WARNS_ONCE("render") << "Ooh, height overrun on pick mask read, that woulda been bad." << LL_ENDL;
- y = llmax(0, mPickMaskHeight-1);
+ y = llmax((U16)0, mPickMaskHeight);
}
S32 idx = y*mPickMaskWidth+x;