Skip to content
Snippets Groups Projects
Commit 417f0ede authored by Tofu Linden's avatar Tofu Linden
Browse files

EXT-4388 Crash in octree line segment intersection code

(more accurately, it was - I believe - reading over the end of a buffer in the pick-mask lookup)

reviewed by qarl.
parent 56f97bce
No related branches found
No related tags found
No related merge requests found
...@@ -1736,12 +1736,25 @@ BOOL LLImageGL::getMask(const LLVector2 &tc) ...@@ -1736,12 +1736,25 @@ BOOL LLImageGL::getMask(const LLVector2 &tc)
if (u < 0.f || u > 1.f || if (u < 0.f || u > 1.f ||
v < 0.f || v > 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 x = (S32)(u * width);
S32 y = (S32)(v * height); 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 idx = y*width+x;
S32 offset = idx%8; S32 offset = idx%8;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment