aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/QPDFObjectHandle.cc
AgeCommit message (Collapse)Author
2020-04-04Avoid potential segfault in warning methodsJay Berkenbilt
2020-04-03Add QPDFObjectHandle::unsafeShallowCopyJay Berkenbilt
2020-04-03Performance: remove Members indirection for QPDFObjectHandleJay Berkenbilt
2020-03-31Refactor QPDFPageObjectHelper::removeUnreferencedResources()Jay Berkenbilt
Refactor removeUnreferencedResources to prepare for filtering form XObjects.
2019-10-22Parse Contents in signature dictionary without encryptionMasamichi Hosoda
Various PDF digital signing tools do not encrypt /Contents value in signature dictionary. Adobe Acrobat Reader DC can handle a PDF with the /Contents value not encrypted. Write Contents in signature dictionary without encryption Tests ensure that string /Contents are not handled specially when not found in sig dicts.
2019-10-22Add QPDFObject::getParsedOffset()Masamichi Hosoda
2019-09-20Correct reversed Rectangle coordinates (fixes #363)Jay Berkenbilt
2019-09-20Warn for duplicated dictionary keys (fixes #345)Jay Berkenbilt
2019-08-26Fix fuzz issue 16301Jay Berkenbilt
2019-08-23Pass offset and length to ParserCallbacks::handleObjectJay Berkenbilt
2019-08-22Test for direct, rather than resolved nulls in parserJay Berkenbilt
Just because we know an indirect reference is null, doesn't mean we shouldn't keep it indirect.
2019-08-22Protect against coding error of re-entrant parsingJay Berkenbilt
2019-08-20Handle invalid name tokens symmetrically for PDF < 1.2 (fixes #332)Jay Berkenbilt
2019-08-18Shallow copy arrays without removing sparsenessJay Berkenbilt
2019-08-18Use SparseOHArray in parsingJay Berkenbilt
2019-08-18Refactor QPDF_Array in preparation for using SparseOHArrayJay Berkenbilt
2019-08-18SparseOHArrayJay Berkenbilt
2019-06-25Convert some cases of logic_error to runtime_errorJay Berkenbilt
There were a few cases that could be caused by invalid input rather than bugs in the code which were throwing logic_error instead of runtime_error.
2019-06-22Add missing #include <cstring>Jay Berkenbilt
2019-06-21Fix bugs found by fuzz testsJay Berkenbilt
* Several assertions in linearization were not always true; change them to run time errors * Handle a few cases of uninitialized objects * Handle pages with no contents when doing form operations * Handle invalid page tree nodes when traversing pages
2019-06-21Fix sign and conversion warnings (major)Jay Berkenbilt
This makes all integer type conversions that have potential data loss explicit with calls that do range checks and raise an exception. After this commit, qpdf builds with no warnings when -Wsign-conversion -Wconversion is used with gcc or clang or when -W3 -Wd4800 is used with MSVC. This significantly reduces the likelihood of potential crashes from bogus integer values. There are some parts of the code that take int when they should take size_t or an offset. Such places would make qpdf not support files with more than 2^31 of something that usually wouldn't be so large. In the event that such a file shows up and is valid, at least qpdf would raise an error in the right spot so the issue could be legitimately addressed rather than failing in some weird way because of a silent overflow condition.
2019-06-21Change QPDFObjectHandle::pipeStreamData's encode_flags typeJay Berkenbilt
Change from unsigned long to int since we pass enumerated type values to this field.
2019-06-21Add new integer accessors to QPDFObjectHandleJay Berkenbilt
2019-06-15Give up reading objects with too many consecutive errorsJay Berkenbilt
2019-04-21Tighten isPageObject (fixes #310)Jay Berkenbilt
2019-02-01Make inline image token exactly contain the image dataJay Berkenbilt
Do not include the trailing EI, and handle cases where EI is not preceded by a delimiter. Such cases have been seen in the wild.
2019-01-31Refactor QPDFTokenizer's inline image handlingJay Berkenbilt
Add a version of expectInlineImage that takes an input source and searches for EI. This is in preparation for improving the way EI is found. This commit just refactors the code without changing the functionality and adds tests to make sure the old and new code behave identically.
2019-01-31Inline image token value ends with EI, not delimiterJay Berkenbilt
The inline image token erroneously included the delimiter that followed EI. The ObjectHandle created from it was correct.
2019-01-27Add QPDFObjectHandle::getUniqueResourceNameJay Berkenbilt
2019-01-26Handle inheritable page attributesJay Berkenbilt
Add getAttribute for handling inheritable page attributes, and fix getPageImages and annotation flattening code to use it.
2019-01-03Switch annotation flattening to use the form xobjectsJay Berkenbilt
Instead of directly putting the contents of the annotation appearance streams into the page's content stream, add commands to render the form xobjects directly. This is a more robust way to do it than the original solution as it works properly with patterns and avoids problems with resource name clashes between the pages and the form xobjects.
2019-01-01Add QPDFObjectHandle::mergeDictionary()Jay Berkenbilt
2019-01-01Add Matrix class under QPDFObjectHandleJay Berkenbilt
2018-12-22Add QPDFObjectHandle::getJSON()Jay Berkenbilt
2018-12-18Add QPDFObjectHandle::wrapInArray()Jay Berkenbilt
Wrap an object in an array if it is not already an array.
2018-06-22Treat content stream parsing errors as an error, not a warningJay Berkenbilt
If parsing content streams is treated as a warning, there is no way for a caller to know if a parsing operation has failed. This is very dangerous and will likely result in data loss when token filters are parser callbacks are in use.
2018-06-22Fix QPDFObjectHandle::shallowCopyJay Berkenbilt
It's not really a shallow copy. It just doesn't cross indirect object boundaries. The old implementation had a bug that would cause multiple shallow copies of the same object to share memory, which was not the intention.
2018-06-21Better support for creating Unicode stringsJay Berkenbilt
2018-06-21Add QPDFObjectHandle::Rectangle typeJay Berkenbilt
Provide a convenient way of accessing rectangles.
2018-04-15Limit depth of nesting in direct objects (fixes #202)Jay Berkenbilt
This fixes CVE-2018-9918.
2018-03-06Properly handle pages with no contents (fixes #194)Jay Berkenbilt
Remove calls to assertPageObject(). All cases in the library that called assertPageObject() work fine if you don't call assertPageObject() because nothing assumes anything that was being checked by that call. Removing the calls enables more files to be successfully processed.
2018-02-19More robust handling of type errorsJay Berkenbilt
Give objects descriptions and context so it is possible to issue warnings instead of fatal errors for attempts to access objects of the wrong type.
2018-02-19Push members of QPDFObjectHandle into a Members objectJay Berkenbilt
As in other cases, this is to enable adding new member variables in the future without breaking ABI compatibility.
2018-02-19Simplify TokenFilter interfaceJay Berkenbilt
Expose Pl_QPDFTokenizer, and have it do more of the work of managing the token filter's pipeline.
2018-02-19Add additional interface for filtering page contentsJay Berkenbilt
2018-02-19Implement TokenFilter and refactor Pl_QPDFTokenizerJay Berkenbilt
Implement a TokenFilter class and refactor Pl_QPDFTokenizer to use a TokenFilter class called ContentNormalizer. Pl_QPDFTokenizer is now a general filter that passes data through a TokenFilter.
2018-02-19Add coalesce contents capabilityJay Berkenbilt
2018-02-19Refactor parseContentStreamJay Berkenbilt
2018-02-19Remove redundant methodJay Berkenbilt
Remove a redundant method that was equal to another one with additional arguments. This breaks binary compatibility, but there are other ABI breaking changes in the upcoming release, so now is the time to do it.
2018-02-19Use inline image token in content parserJay Berkenbilt