You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Kevin Jackson (JIRA)" <ji...@apache.org> on 2010/11/23 06:47:16 UTC
[jira] Created: (PDFBOX-900) ArrayIndexOutOfBoundsException with
extracting labels from malformed document
ArrayIndexOutOfBoundsException with extracting labels from malformed document
-----------------------------------------------------------------------------
Key: PDFBOX-900
URL: https://issues.apache.org/jira/browse/PDFBOX-900
Project: PDFBox
Issue Type: Bug
Reporter: Kevin Jackson
This document opens fine in Adobe Reader but inside there is a negative page label offset. This results in an ArrayIndexOutOfBoundsException in getLabelsByPageIndices() in PDFBox
My patch is to ignore that page label.
### Eclipse Workspace Patch 1.0
#P pdfbox
Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java
===================================================================
--- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (revision 1026306)
+++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (working copy)
@@ -108,7 +108,9 @@
Map<Integer, COSDictionary> numbers = node.getNumbers();
for (Entry<Integer, COSDictionary> i : numbers.entrySet())
{
- labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
+ if (i.getKey() >= 0) {
+ labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
+ }
}
}
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-900) ArrayIndexOutOfBoundsException with
extracting labels from malformed document
Posted by "Kevin Jackson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Jackson updated PDFBOX-900:
---------------------------------
Component/s: PDModel
Affects Version/s: 1.3.1
> ArrayIndexOutOfBoundsException with extracting labels from malformed document
> -----------------------------------------------------------------------------
>
> Key: PDFBOX-900
> URL: https://issues.apache.org/jira/browse/PDFBOX-900
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.3.1
> Reporter: Kevin Jackson
> Attachments: page_label.pdf
>
>
> This document opens fine in Adobe Reader but inside there is a negative page label offset. This results in an ArrayIndexOutOfBoundsException in getLabelsByPageIndices() in PDFBox
> My patch is to ignore that page label.
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (revision 1026306)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (working copy)
> @@ -108,7 +108,9 @@
> Map<Integer, COSDictionary> numbers = node.getNumbers();
> for (Entry<Integer, COSDictionary> i : numbers.entrySet())
> {
> - labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + if (i.getKey() >= 0) {
> + labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + }
> }
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (PDFBOX-900) ArrayIndexOutOfBoundsException with
extracting labels from malformed document
Posted by "Kevin Jackson (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Kevin Jackson updated PDFBOX-900:
---------------------------------
Attachment: page_label.pdf
> ArrayIndexOutOfBoundsException with extracting labels from malformed document
> -----------------------------------------------------------------------------
>
> Key: PDFBOX-900
> URL: https://issues.apache.org/jira/browse/PDFBOX-900
> Project: PDFBox
> Issue Type: Bug
> Reporter: Kevin Jackson
> Attachments: page_label.pdf
>
>
> This document opens fine in Adobe Reader but inside there is a negative page label offset. This results in an ArrayIndexOutOfBoundsException in getLabelsByPageIndices() in PDFBox
> My patch is to ignore that page label.
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (revision 1026306)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (working copy)
> @@ -108,7 +108,9 @@
> Map<Integer, COSDictionary> numbers = node.getNumbers();
> for (Entry<Integer, COSDictionary> i : numbers.entrySet())
> {
> - labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + if (i.getKey() >= 0) {
> + labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + }
> }
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (PDFBOX-900) ArrayIndexOutOfBoundsException with
extracting labels from malformed document
Posted by "Adam Nichols (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PDFBOX-900?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Adam Nichols resolved PDFBOX-900.
---------------------------------
Resolution: Fixed
Fix Version/s: 1.4.0
Assignee: Adam Nichols
Tested fix and committed to SVN along with a test case to ensure this issue doesn't reappear later. Thanks for the patch and the test file. Committed in revision 1038216.
> ArrayIndexOutOfBoundsException with extracting labels from malformed document
> -----------------------------------------------------------------------------
>
> Key: PDFBOX-900
> URL: https://issues.apache.org/jira/browse/PDFBOX-900
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 1.3.1
> Reporter: Kevin Jackson
> Assignee: Adam Nichols
> Fix For: 1.4.0
>
> Attachments: page_label.pdf
>
>
> This document opens fine in Adobe Reader but inside there is a negative page label offset. This results in an ArrayIndexOutOfBoundsException in getLabelsByPageIndices() in PDFBox
> My patch is to ignore that page label.
> ### Eclipse Workspace Patch 1.0
> #P pdfbox
> Index: pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java
> ===================================================================
> --- pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (revision 1026306)
> +++ pdfbox/src/main/java/org/apache/pdfbox/pdmodel/common/PDPageLabels.java (working copy)
> @@ -108,7 +108,9 @@
> Map<Integer, COSDictionary> numbers = node.getNumbers();
> for (Entry<Integer, COSDictionary> i : numbers.entrySet())
> {
> - labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + if (i.getKey() >= 0) {
> + labels.put(i.getKey(), new PDPageLabelRange(i.getValue()));
> + }
> }
> }
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.