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
master
Eric M. Tulla (BigPapi) 2010-02-01 15:47:16 -05:00
parent c339017d2e
commit ec5ad98abe
1 changed files with 1 additions and 1 deletions

View File

@ -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