Skip to content

Commit b254377

Browse files
committed
PDFBOX-5927: prevent dictionary key from becoming an indirect object in an object stream
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1922608 13f79535-47bb-0310-9956-ffa450edef68
1 parent af63a31 commit b254377

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pdfbox/src/main/java/org/apache/pdfbox/pdfwriter/compress/COSWriterObjectStream.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,10 @@ private void writeCOSDictionary(OutputStream output, COSDictionary cosDictionary
347347
{
348348
if (entry.getValue() != null)
349349
{
350-
writeObject(output, entry.getKey(), false);
350+
// PDFBOX-5927: topLevel true to avoid having a dictionary key as an indirect object
351+
// if it already exists as such
352+
writeObject(output, entry.getKey(), true);
353+
351354
writeObject(output, entry.getValue(), false);
352355
}
353356
}

0 commit comments

Comments
 (0)