Skip to content

Commit f765bf5

Browse files
committed
PDFBOX-5917: when offset points to end of the stream then it's empty
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922270 13f79535-47bb-0310-9956-ffa450edef68
1 parent 1517eed commit f765bf5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fontbox/src/main/java/org/apache/fontbox/ttf/GlyphTable.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,11 +138,12 @@ GlyphData getGlyph(int gid, int level) throws IOException
138138
// read a single glyph
139139
long[] offsets = loca.getOffsets();
140140

141-
if (offsets[gid] == offsets[gid + 1])
141+
if (offsets[gid] == offsets[gid + 1] || offsets[gid] == data.getOriginalDataSize())
142142
{
143143
// no outline
144144
// PDFBOX-5135: can't return null, must return an empty glyph because
145145
// sometimes this is used in a composite glyph.
146+
// PDFBOX-5917: offset points to end of the stream
146147
glyph = new GlyphData();
147148
glyph.initEmptyData();
148149
}

0 commit comments

Comments
 (0)