Author: tilman
Date: Sat Aug 30 15:28:34 2025
New Revision: 1928112
Log:
PDFBOX-5660: add check, as suggested by Valery Bokov; closes #231
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Sat Aug 30 15:26:30 2025 (r1928111)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Sat Aug 30 15:28:34 2025 (r1928112)
@@ -657,7 +657,7 @@ public class Splitter
* This will set the end page.
*
* @param end the 1-based end page
- * @throws IllegalArgumentException if the end page is smaller than one.
+ * @throws IllegalArgumentException if the end page is smaller than one or
than the start page.
*/
public void setEndPage(int end)
{
@@ -665,6 +665,10 @@ public class Splitter
{
throw new IllegalArgumentException("End page is smaller than one");
}
+ if (end < startPage)
+ {
+ throw new IllegalArgumentException("End page is smaller than
startPage");
+ }
endPage = end;
}