Commit 6574dc5c030f866d560dc43cc7a10263ebc71e27
1 parent
34491c61
Store indirect nulls in QPDF_Dictionary
Showing
1 changed file
with
3 additions
and
1 deletions
libqpdf/QPDF_Dictionary.cc
| @@ -122,7 +122,9 @@ void | @@ -122,7 +122,9 @@ void | ||
| 122 | QPDF_Dictionary::replaceKey(std::string const& key, QPDFObjectHandle value) | 122 | QPDF_Dictionary::replaceKey(std::string const& key, QPDFObjectHandle value) |
| 123 | { | 123 | { |
| 124 | if (value.isNull() && !value.isIndirect()) { | 124 | if (value.isNull() && !value.isIndirect()) { |
| 125 | - // The PDF spec doesn't distinguish between keys with null values and missing keys. | 125 | + // The PDF spec doesn't distinguish between keys with null values and missing keys. Allow |
| 126 | + // indirect nulls which are equivalent to a dangling reference, which is permitted by the | ||
| 127 | + // spec. | ||
| 126 | removeKey(key); | 128 | removeKey(key); |
| 127 | } else { | 129 | } else { |
| 128 | // add or replace value | 130 | // add or replace value |