Browse Source
Merge pull request #10725 from Gillibald/fixes/tabOutOfRange
[Text] Fix potential index out of range exception
release/11.0.0-preview6
Dan Walmsley
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
2 additions and
2 deletions
-
src/Skia/Avalonia.Skia/TextShaperImpl.cs
-
src/Windows/Avalonia.Direct2D1/Media/TextShaperImpl.cs
|
|
|
@ -72,7 +72,7 @@ namespace Avalonia.Skia |
|
|
|
|
|
|
|
var glyphOffset = GetGlyphOffset(glyphPositions, i, textScale); |
|
|
|
|
|
|
|
if (textSpan[i] == '\t') |
|
|
|
if (i < textSpan.Length && textSpan[i] == '\t') |
|
|
|
{ |
|
|
|
glyphIndex = typeface.GetGlyph(' '); |
|
|
|
|
|
|
|
|
|
|
|
@ -68,7 +68,7 @@ namespace Avalonia.Direct2D1.Media |
|
|
|
|
|
|
|
var glyphOffset = GetGlyphOffset(glyphPositions, i, textScale); |
|
|
|
|
|
|
|
if (textSpan[i] == '\t') |
|
|
|
if (i < textSpan.Length && textSpan[i] == '\t') |
|
|
|
{ |
|
|
|
glyphIndex = typeface.GetGlyph(' '); |
|
|
|
|
|
|
|
|