aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf
AgeCommit message (Collapse)Author
2019-06-21Remove implicit conversion from int/pointer to boolJay Berkenbilt
This fixes cases of warning C4800 from msvc
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-21Pl_Flate: constructor's out_bufsize is now unsigned intJay Berkenbilt
This is the type we need for the underlying zlib implementation.
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-21QUtil: add unsigned int/string functionsJay Berkenbilt
2019-06-21configure: determine wordsize automaticallyJay Berkenbilt
Based on sizeof(size_t). Assumes 64 if not 32.
2019-06-21Appearance streams: some floating point values were truncatedJay Berkenbilt
Bounding box X coordinates could be truncated, causing them to be off by a fraction of a point. This was most likely not visible, but it was still wrong.
2019-06-15Fix problems found in fuzz corpusJay Berkenbilt
2019-06-15Give up reading objects with too many consecutive errorsJay Berkenbilt
2019-06-15Eliminate one potential integer overflowJay Berkenbilt
There are more to handle, but this resolves an issue already caught by oss-fuzz.
2019-06-09Handle empty DecodeParams array for (fixes #331)Jay Berkenbilt
On read, ignore /DecodeParms when empty list; on write, delete it. Some files have been found that include an empty list for /DecodeParms, but this is not technically compliant with the spec, and the only sensible interpretation is to treat it as if there are no decode parameters.
2019-05-18Prepare 8.4.2 releaseJay Berkenbilt
2019-05-16Fix Windows memory error (fixes #330)Jay Berkenbilt
2019-04-28Prepare 8.4.1 releaserelease-qpdf-8.4.1Jay Berkenbilt
2019-04-21Spell checkJay Berkenbilt
2019-04-21Support Unicode in filenames (fixes #298)Jay Berkenbilt
2019-04-21Tighten isPageObject (fixes #310)Jay Berkenbilt
2019-03-12Undefined functions because of missing std:: or header. (#295)Thorsten Schöning
* [bcc32 Error] QPDF.cc(375): E2268 Call to undefined function 'atof' Full parser context QPDF.cc(358): parsing: void QPDF::parse(const char *) * [bcc32 Error] QPDFTokenizer.cc(183): E2268 Call to undefined function 'strtol' Full parser context QPDFTokenizer.cc(163): parsing: void QPDFTokenizer::resolveLiteral() * [bcc32 Error] pdf-split-pages.cc(52): E2268 Call to undefined function 'exit' Full parser context pdf-split-pages.cc(50): parsing: void usage() * PR #295: Including "cstdlib" should be replaced with "stdlib.h" to be more consistent. At the same time I changed the order of the surrounding includes to reflect alphabetical order, because at some files this already have been the case.
2019-03-11"_setmode" and "_stricmp" are not available on Borland C++Builder, neither ↵Thorsten Schöning
the classic one nor newer ones based on CLANG.
2019-03-11Fix json serialization for {x | -1 < x < 1} (fixes #308)Jay Berkenbilt
JSON serialization was preserving the value as presented, but JSON doesn't accept decimal values without a 0 before the decimal point.
2019-02-02Prepare 8.4.0 releaseJay Berkenbilt
2019-02-01Spell checkJay 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-31Externalize inline images (fixes #278)Jay Berkenbilt
2019-01-31Exclude space after ID in image dataJay Berkenbilt
2019-01-31Improve locating inline image's EIJay Berkenbilt
We've actually seen a PDF file in the wild that contained EI surrounded by delimiters inside the image data, which confused qpdf's naive code. This significantly improves EI detection.
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-30Clean up some private functionsJay Berkenbilt
2019-01-29Handle direct page objects (fixes #164)Jay Berkenbilt
2019-01-29Clarify documentation for copyForeignObject regarding pagesJay Berkenbilt
Make explicit that copyForeignObject can be used on page objects and will copy them properly but not update the pages tree.
2019-01-29Fix logic for when to compress object and xref streams (fixes #271)Jay Berkenbilt
2019-01-29Resolve duplicated page objects (fixes #268)Jay Berkenbilt
When linearizing a file or getting the list of all pages in a file, detect if the pages tree contains a duplicated page object and, if so, shallow copy it. This makes it possible to have a one to one mapping of page positions to page objects.
2019-01-27Convert pages to form XObjectsJay Berkenbilt
Support conversion of pages to form XObjects and placement of form XObjects on pages.
2019-01-27Move rectangle transformation into QPDFMatrixJay Berkenbilt
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-21Handle fallback font size in text appearancesJay Berkenbilt
If we end up using our fallback font size when generating appearances for text fields, reflect that in the Tf operator used in the appearance stream.
2019-01-21Improve text objects used in text appearance streamsJay Berkenbilt
2019-01-21Fix omissions in text appearance generationJay Berkenbilt
When generating appearance streams for variable text annotations, properly handle the cases of there being no appearance dictionary, no appearance stream, or an appearance stream with no BMC..EMC marker.
2019-01-21When flattening, remove annotations with no appearance streamJay Berkenbilt
With the exception of form field annotations when /NeedAppearances is true, remove annotations that don't have appearance streams when flattening. There is no reason to keep these when flattening since they are invisible. This may include unchecked checkboxes, unshown popup windows, etc.
2019-01-19mingw workaround for QPDFExc destructorJay Berkenbilt
mingw doesn't like it when you don't inline empty virtual destructors.
2019-01-17Add QUtil::possible_repaired_encodingsJay Berkenbilt
2019-01-17Modernize encryption API for more granularityJay Berkenbilt
Setting encryption permissions for R >= 3 set permission bits in groups corresponding to menu options in Acrobat 5. The new API allows the bits to be set individually.
2019-01-17Add status-reporting transcoders to QUtilJay Berkenbilt
2019-01-17QUtil::analyze_encodingJay Berkenbilt
2019-01-17Bidirectional transcoding for win, mac, pdf, utf8, utf16Jay Berkenbilt
2019-01-17Move remaining existing transcoding to QUtilJay Berkenbilt
2019-01-17Additional checks for unreferenced resourcesJay Berkenbilt
Explicitly abandon removal of unreferenced resources if there are any lexical errors in the page's contents. This case always generated a warning, but it now also prevents removal of unreferenced resources, this strongly decreasing the likelihood of data loss.