From 35b4ca0e8423e4cc0589b031854b9e5a0f000ebe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Lehmk=C3=BChler?= Date: Sun, 13 Aug 2023 10:56:47 +0000 Subject: [PATCH] PDFBOX-5651: fix hasNext condition to avoid NoSuchElementEWxception git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1911625 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java index cafc06cfc1f..6202660de4f 100755 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFXrefStreamParser.java @@ -221,7 +221,7 @@ public boolean hasNext() { return currentNumber < currentEnd; } - return currentRange < start.length || currentNumber < currentEnd; + return currentRange < start.length - 1 || currentNumber < currentEnd; } @Override