summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric M. Tulla (BigPapi) <tulla@lindenlab.com>2010-02-01 15:47:16 -0500
committerEric M. Tulla (BigPapi) <tulla@lindenlab.com>2010-02-01 15:47:16 -0500
commitec5ad98abe0dde6f314bcd8c67a193a672c53aca (patch)
tree28a901031fa1b431d641e84a2bd4f86d3022435c
parentc339017d2e156a68f1e300a7668f2a9f6e6141f7 (diff)
EXT-4848 - Crash when trying to view chicklet(?). Bug in word wrap logic.
Added a clamp to >= 0 for num pixels so we don't hit the assert. -Reviewed by Nyx
-rw-r--r--indra/llui/lltextbase.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index 978bd317e2..dfe3e9b61e 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -2512,7 +2512,7 @@ S32 LLNormalTextSegment::getNumChars(S32 num_pixels, S32 segment_offset, S32 lin
LLUIImagePtr image = mStyle->getImage();
if( image.notNull())
{
- num_pixels -= image->getWidth();
+ num_pixels = llmax(0, num_pixels - image->getWidth());
}
// search for newline and if found, truncate there