-
…string`, improving performance, simplifying stream data handling, and reducing dependency on `BufferInputSource`.
-
…std::string_view`, improving performance and code clarity.
-
…cess for consistency and readability.
-
Simplify `readObjectAtOffset` by splitting responsibilities into separate functions: `read_object_start` and a streamlined `readObjectAtOffset`. Remove redundant parameters and improve code readability, ensuring better modularity for object reading operations.
-
After xref reconstruction treat the input file as suspect and apply sanity checks to all subsequent object reads. Remove `in_xref_reconstruction` flag and update references to use `reconstructed_xref` for simplified state management during xref processing. Adjust warnings for invalid dictionary keys in test output.
-
the xref table has been loaded
-
Detect corrupt xref streams early to avoid excessive runtime and memory usage.
-
Backup and restore the xref table during attempted startxref recovery to avoid corrupt states. Added a guard condition to handle invalid xref entries types, preventing processing of unsupported cases. These changes improve robustness during PDF parsing and recovery.
-
Replaced raw pointer defaults (e.g., `0`) with `nullptr` for better readability and type-safety. Simplified object initializer syntax using uniform initialization `{}`. These changes enhance code maintainability and ensure modern C++ standards compliance. -
Simplified checks for empty containers and strings across the codebase using the `.empty()` method. This improves code readability and adheres to best practices for checking emptiness.
-
Converted multiple occurrences of `count()` to `contains()` throughout the codebase where the goal was to check key existence in containers. This improves code readability and aligns with modern C++ practices, particularly with C++20, making the intent more explicit and potentially aiding performance.
-
During xref table reconstruction ignore uncompressed object entries found in xref streams. The xref table gets populated with entries for the objects actually found in the file. The entries for uncompressed object in xref streams are redundant and potentially incorrect.
-
Reject objects containing arrays or dictionaries with more than 5000 elements. We are by definition dealing with damaged files, and such objects are extremely likely to be invalid or malicious.
-
As discussed in #1396.
-
Internally use -1 to represent a missing offset and provide a constructor overload that allows 0 as a valid offset. In QPDF::damagedPDF use the new overload.
-
... containing objects with no white-space between them. To enforce the rule that objects end at the start-offset of the next object, each object is parsed in it own object stream. To facilitate this, a new private API input source is::OffsetBuffer has been added which only contains the object but reports offsets relative to the start of the object stream. This is adapted from OffsetInputSource by changing the direction of the offset, endowing it with its own BufferInputSource and striooing out checks duplicated in BufferInputSource. Fixes the expected failure in the test case added in #1266.
-
Add static parse methods. Make all external access to QPDFParser through static methods. Make all non-static methods including constructors private.
-
Only build strings when needed.
-
This was due to the use of last_object_description, which is not set for the object stream itself. Also, modify the messages introduced #1391 and #1392 to report the supposed offset of the objects.
-
Move methods responsible for loading or keeping track of objects to QPDF_objects.cc. The split was part of the reverted #1297. Reintroducing it now makes it easier/safer to keep the work to refactor the xref and object tables in sync with main.
-
This reverts commit c648b9a018105a3c30b3e7f3c5f8a058d3ddd92c, reversing changes made to 12b67a3227df6b6df3a4f5f098e11cce173ff7d5.
-
This reverts commit 54cf0e519c49e3fb44c7ca1de95a1fffbafc211c, reversing changes made to c648b9a018105a3c30b3e7f3c5f8a058d3ddd92c.
-
Also, make obj_cache private and rename to table.
-
Move methods responsible for loading or keeping track of objects to QPDF_objects.cc.