Author: tilman
Date: Sat Aug 30 15:28:41 2025
New Revision: 1928114
Log:
PDFBOX-5660: add check, as suggested by Valery Bokov; closes #231
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Sat Aug 30 15:28:37 2025 (r1928113)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
Sat Aug 30 15:28:41 2025 (r1928114)
@@ -658,7 +658,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)
{
@@ -666,6 +666,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;
}