Age | Commit message (Collapse) | Author |
|
|
|
|
|
StreamDataProvider::provideStreamData now has a rich enough API for it
to effectively proxy to pipeStreamData.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This also reverts the addition of a new checkLinearization that
distinguishes errors from warnings. There's no practical distinction
between what was considered an error and what was considered a
warning.
|
|
|
|
|
|
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.
|
|
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 &)
|
|
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
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
A few public destructors were missing QPDF_DLL, which could cause some
Windows applications to fail to link.
|
|
|
|
This is the beginning of higher-level API support using helper
classes. The goal is to be able to add more helpers without continuing
to pollute QPDF's and QPDFObjectHandle's public interfaces.
|
|
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.
|
|
Add options to enable the raw encryption key to be directly shown or
specified. Thanks to Didier Stevens <didier.stevens@gmail.com> for the
idea and contribution of one implementation of this idea.
|
|
|
|
The Apache License version 2.0 is now the primary license for qpdf.
However, users may, at their option, continue to use Artistic version
2.0.
|
|
Tweak the message so that we inform the user that we are mitigating
data loss.
|
|
|
|
While scanning the file looking for objects, limit the length of
tokens we allow. This prevents us from getting caught up in reading a
file character by character while digging through large streams.
|
|
Pushing member variables into a nested class enables addition of new
member variables without breaking binary compatibility.
|
|
|
|
Also accept more errors than before.
|
|
Eliminate PCRE and find endobj not preceded by endstream. Be more lax
about placement of endstream and endobj.
|
|
|
|
|
|
Preparing to refactor some pattern searching code to use these instead
of their own memchr loops. This should simplify the code that replaces
PCRE.
|
|
Sometimes we want to ignore bad tokens rather than having them throw
an exception. A coverage case is commented out here and added in a
later commit.
|
|
Be explicit about the need to keep the source QPDF object around.
|
|
|