Age | Commit message (Collapse) | Author |
|
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.
|
|
This is the type we need for the underlying zlib implementation.
|
|
Change from unsigned long to int since we pass enumerated type values
to this field.
|
|
|
|
|
|
|
|
|
|
Fix C++ exception handling when -fvisibility=hidden
Ensure that QPDFExc and QPDFSystemError are marked visible, so that their typeinfo will not be
suppressed when -fvisibility=hidden.
Details:
https://gcc.gnu.org/wiki/Visibility
|
|
Full parser context
QPDF.cc(2): #include ..\..\..\..\src\include\qpdf\QPDF.hh
QPDF.hh(48): class QPDF
QPDF.hh(1380): decision to instantiate: QPDF::ResolveRecorder::ResolveRecorder(QPDF *,const QPDFObjGen &)
--- Resetting parser context for instantiation...
QPDF.hh(799): parsing: QPDF::ResolveRecorder::ResolveRecorder(QPDF *,const QPDFObjGen &)
|
|
'QPDFObjectHandle::Members::obj' is not accessible
Full parser context
Pl_QPDFTokenizer.cc(1): #include ..\..\..\..\src\include\qpdf\Pl_QPDFTokenizer.hh
Pl_QPDFTokenizer.hh(29): #include ..\..\..\..\src\include\qpdf/QPDFObjectHandle.hh
QPDFObjectHandle.hh(51): class QPDFObjectHandle
QPDFObjectHandle.hh(1052): decision to instantiate: PointerHolder<QPDFObject> QPDFObjectHandle::ObjAccessor::getObject(QPDFObjectHandle &)
--- Resetting parser context for instantiation...
QPDFObjectHandle.hh(909): parsing: PointerHolder<QPDFObject> QPDFObjectHandle::ObjAccessor::getObject(QPDFObjectHandle &)
|
|
Full parser context
QPDF.cc(2): #include ..\..\..\..\src\include\qpdf\QPDF.hh
QPDF.hh(47): class QPDF
|
|
Full parser context
QPDF.cc(2): #include ..\..\..\..\src\include\qpdf\QPDF.hh
QPDF.hh(46): class QPDF
|
|
|
|
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.
|
|
|
|
|
|
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.
|
|
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.
|
|
|
|
Make explicit that copyForeignObject can be used on page objects and
will copy them properly but not update the pages tree.
|
|
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.
|
|
Support conversion of pages to form XObjects and placement of form
XObjects on pages.
|
|
|
|
Add getAttribute for handling inheritable page attributes, and fix
getPageImages and annotation flattening code to use it.
|
|
|
|
mingw doesn't like it when you don't inline empty virtual destructors.
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
The original QPDF is only required now when the source
QPDFObjectHandle is a stream that gets its stream data from a
QPDFObjectHandle::StreamDataProvider.
|
|
This is in preparation of being able to pipe a stream's data without
keeping a copy of its containing qpdf object.
|
|
Use this instead of QPDF* as a map key for object_copiers.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Instead of calling assert for problems found during checking
linearization data, throw an exception which is later caught and
issued as an error. Ideally we would handle errors more robustly, but
this is still a significant improvement.
|
|
On certain operations, such as iterating through all objects and
adding new indirect objects, walk through the entire object structure
and explicitly resolve any indirect references to non-existent
objects. That prevents new objects from springing into existence and
causing the previously dangling references to point to them.
|
|
|
|
|
|
|