From 5f94129ca5b59adcab22060ce1092f8bc05c8a21 Mon Sep 17 00:00:00 2001 From: Tilman Hausherr Date: Thu, 21 Nov 2024 14:45:20 +0000 Subject: [PATCH] PDFBOX-5906: ignore isolated + git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1921994 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/pdfbox/pdfparser/PDFStreamParser.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java index 91196d20669..117c913e0e3 100644 --- a/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdfparser/PDFStreamParser.java @@ -222,7 +222,14 @@ else if( next.equals( "false" ) ) dotNotRead = false; } } - return COSNumber.get(buf.toString()); + String s = buf.toString(); + if ("+".equals(s)) + { + // PDFBOX-5906 + LOG.warn("isolated '+' is ignored"); + return COSNull.NULL; + } + return COSNumber.get(s); case 'B': String nextOperator = readString(); Operator beginImageOP = Operator.getOperator(nextOperator);