Commit 97a7ad1d80c24fdda0db2cef0cb9280113f7793e

Authored by m-holger
1 parent 7402c02c

Avoid setting descriptions / offsets for direct nulls in QPDFParser::parse

Part of #729
Showing 1 changed file with 6 additions and 2 deletions
libqpdf/QPDFParser.cc
... ... @@ -272,8 +272,12 @@ QPDFParser::parse(bool& empty, bool content_stream)
272 272  
273 273 case st_dictionary:
274 274 case st_array:
275   - setDescriptionFromInput(object, input->getLastOffset());
276   - object.setParsedOffset(input->getLastOffset());
  275 + if (!object.isDirectNull()) {
  276 + // No need to set description for direct nulls- they will
  277 + // become implicit.
  278 + setDescriptionFromInput(object, input->getLastOffset());
  279 + object.setParsedOffset(input->getLastOffset());
  280 + }
277 281 set_offset = true;
278 282 olist.push_back(object);
279 283 break;
... ...