Skip to content

Commit dbab537

Browse files
author
Samuel Huylebroeck
committed
Guard against array out of bounds exception in TextRenderer
TSALES-1454
1 parent 6a4ae76 commit dbab537

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

layout/src/main/java/com/itextpdf/layout/renderer/TextRenderer.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ public LayoutResult layout(LayoutContext layoutContext) {
267267

268268
Glyph currentGlyph = text.get(ind);
269269
if (noPrint(currentGlyph)) {
270-
if (splitCharacters.isSplitCharacter(text, ind + 1) &&
270+
if (ind + 1 == text.end ||
271+
splitCharacters.isSplitCharacter(text, ind + 1) &&
271272
TextUtil.isSpaceOrWhitespace(text.get(ind + 1))) {
272273
nonBreakablePartEnd = ind;
273274
break;

0 commit comments

Comments
 (0)