Author: tilman
Date: Sat Aug 30 15:28:37 2025
New Revision: 1928113

Log:
PDFBOX-5660: add check, as suggested by Valery Bokov; closes #231

Modified:
   
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java

Modified: 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
==============================================================================
--- 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
   Sat Aug 30 15:28:34 2025        (r1928112)
+++ 
pdfbox/branches/3.0/pdfbox/src/main/java/org/apache/pdfbox/multipdf/Splitter.java
   Sat Aug 30 15:28:37 2025        (r1928113)
@@ -656,7 +656,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)
     {
@@ -664,6 +664,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;
     }
 

Reply via email to