From: ANZ1217 Date: Thu, 9 Jan 2025 08:22:34 +0000 (+0900) Subject: Fix potential out-of-bounds access during glyph-character calculations. X-Git-Tag: accepted/tizen/unified/20250115.005102~2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F82%2F317882%2F9;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Fix potential out-of-bounds access during glyph-character calculations. Change-Id: Ic3b859a491056188693ef64edab8a74d094b720d --- diff --git a/dali-toolkit/internal/text/visual-model-impl.cpp b/dali-toolkit/internal/text/visual-model-impl.cpp index 2f3ea3efe3..369bd5ff06 100644 --- a/dali-toolkit/internal/text/visual-model-impl.cpp +++ b/dali-toolkit/internal/text/visual-model-impl.cpp @@ -61,7 +61,7 @@ void VisualModel::CreateCharacterToGlyphTable(CharacterIndex startIndex, } else { - mCharactersToGlyph.Resize(numberOfCharacters); + mCharactersToGlyph.Resize(startIndex + numberOfCharacters); charactersToGlyphBuffer = mCharactersToGlyph.Begin() + startIndex; } @@ -137,7 +137,7 @@ void VisualModel::CreateGlyphsPerCharacterTable(CharacterIndex startIndex, } else { - mGlyphsPerCharacter.Resize(numberOfCharacters); + mGlyphsPerCharacter.Resize(startIndex + numberOfCharacters); glyphsPerCharacterBuffer = mGlyphsPerCharacter.Begin() + startIndex; }