Skip to content

Commit b9241af

Browse files
committed
PDFBOX-5972: avoid infinite loop, as suggested by Michael Flester
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1924271 13f79535-47bb-0310-9956-ffa450edef68
1 parent 63b8130 commit b9241af

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

fontbox/src/main/java/org/apache/fontbox/cmap/CMapParser.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,10 @@ private Number readNumber(RandomAccessRead randomAcccessRead, int firstByte) thr
652652
buffer.append((char) nextByte);
653653
nextByte = randomAcccessRead.read();
654654
}
655-
randomAcccessRead.rewind(1);
655+
if (nextByte != -1)
656+
{
657+
randomAcccessRead.rewind(1);
658+
}
656659
String value = buffer.toString();
657660
try
658661
{

0 commit comments

Comments
 (0)