Age | Commit message (Collapse) | Author |
|
|
|
There were two issues with the code parsing the triangle mesh's
edge flags:
* meshes were not require to start with an independent triangle
* out of range edge flags caused vertices to be ignored
A mesh where the edge flag of the first vertice is out of range,
and the edge flag of the second vertex indicates continuation
of a prior triangle would result in trying to create a triangle
where the third coordinate would be uninitialized.
This commit requires the edge flag of the first vertex to indicate
a new independent triangle and if out of range edge flags are
encountered they are treated as if they indicate a new triangle.
Thanks to oss-fuzz for reporting.
|
|
When fz_draw_clip_image_mask() calls fz_get_pixmap_from_image()
may throw an exception, in this case beacuse a predicted image
has an unsupported number of components (1, 2, 4, 8 and 16 are
supported, but 6 is not). When this happens the recently pushed
stack element is never popped, which later trips an assert() in
fz_draw_end_group() at a later stage.
By moving the call to fz_get_pixmap_from_image() inside fz_try
the stack will be popped, thus avoiding triggering the assert().
This also requires the pixmap variable to be fz_var()ed because
it changes inside the fz_try-block.
|
|
|
|
In the Javascript function AFSpecial_KeystrokeEx, if there are characters
left over after exhausting the format string, it's not a match.
|
|
This fixes part of bug #699577.
The keystroke event was preventing form fields being cleared, which is
presumably not intended behaviour.
|
|
|
|
|
|
|
|
Follow bin2coff layout for hexdumped data instead of trying to emulate
the objcopy layout (which seems to break for the android tools).
Only use the basename of the resource in hexdump / bin2coff.
Ifdef on HAVE_OBJCOPY instead of _WIN32.
|
|
pdf_get_inheritable also looks in trailer/Root/AcroForm for missing keys,
but this behavior is not supported by anything in the specification.
|
|
Remove duplicate function pdf_lookup_inherited_page_item.
|
|
|
|
The macro is only set when building the pkcs7-helper library, so cannot
be used by client code. Build stub functions when compiling the
pkcs7-openssl helper library without libcrypto.
|
|
Use separate functions to keep the code simpler.
Use memmem to simplify and optimize search for 'endstream' token.
Do not look for 'endobj' since that could cause a false positives in
compressed object streams that have duff lengths.
|
|
|
|
The intent is for a user to iterate over the annotations on a page calling
pdf_update_annot for each one. If this function returns true, then the
annotation has changed since the last time it was called, and the user
needs to re-render.
pdf_update_page is a simple loop over the annotations on a page, for use
if you only care about page level granularity.
Users should no longer look at or change the pdf_annot.has_new_ap field.
|
|
Thanks to oss-fuzz for reporting.
|
|
When pdf_xobject_transparency() indicates transparency,
pdf_run_xobject() will push a mask with 2 components (gray +
alpha). Because fz_var was missing for the transparency variable
its value would, if fz_throw() was called, not be preserved in
fz_always{}. This means that fz_always{} would never pop the mask
from the stack. At a later stage some code would call
fz_end_mask() and then trigger an assert() where the number of
components was restricted to 1.
Marking the variable with fz_var means that the mask will now be
popped as expected. Thanks to oss-fuzz for reporting.
|
|
|
|
The intent with the previous code was to default to black
upon unsupported number of components in the color array.
The code however first set all components to zero then to
the value of the first component of the color array. Now
the code follows the original intent.
|
|
Thanks to oss-fuzz for reporting.
|
|
|
|
Thanks to oss-fuzz for reporting.
|
|
|
|
Alter pdf_can_be_saved_incrementally to return false when a hybrid xref
file has been opened. This doesn't enforce the behaviour, but will ensure
it for apps that determine their behaviour via this test function.
Once changes have been saved to such a file, it is no longer hybrid and so
further saving steps can use incremental updates.
This change was made because we were previously unable to sign hybrid xref
documents in a way that was satisfactory to Adobe Reader. Adobe Reader
reorganises hybrid xref files, thus invalidating any signature.
|
|
|
|
|
|
Always look for the "endstream" marker after a PDF stream to see
if we've hit the end. Allow for "endobj" to cope with producers
that omit endstream entirely.
Avoid slowing down legal files by only checking for the end marker
after the specified length has been read.
|
|
If you define DUMP_LEXER_STREAM than the lexer dumps the input
that it reads from the stream.
|
|
A missing CIDToGIDMap is treated as identity.
|
|
|
|
These got broken during the fz_rect/fz_matrix pass-by-value
changes.
|
|
|
|
Failure within this function could lead to segfaults in drop_signer. The
problem was early allocation of the signer struct without setting its
drop method, so that on error signer was non-null, but not in a state
where drop_signer could be called.
|
|
When a document is signed multiple times, an incremental update is needed
for each, the multiple updates sometimes written to the file as a single
saving operation. Within pdf_sign_signature it is the call to
pdf_signature_set_value that marks the current section of the xref to which
changes are recorded as "full", so that subsequent changes will trigger the
creation of a new section. Within pdf_sign_signature we were creating the
signature's appearance stream after the call to pdf_signature_set_value and
hence triggering an extra unnecessary setction. This commit moves the
pdf_signature_set_value to after the creation of the appearance stream, so
that we need only as many new xref sections as there are signings.
|
|
The pdf_update_signature_appearance function must be called directly by
the signing code when it signs the document; as only the signing code has
all the text that needs to be written into the appearance.
|
|
Create a matrix that transforms a page with resolution and rotation,
and grid fits the resulting bounding box.
|
|
|
|
|
|
|
|
|
|
Several things irk me about passing values as const pointers:
* They can be NULL, which is not a valid value.
* They require explicit temporary variables for storage.
* They don't compose easily in a legible manner, requiring
weird pointer passing semantics where the variable being assigned
is hidden as an argument in the innermost function call.
* We can't change the value through the pointer, requiring yet more
local variables to hold copies of the input value.
In the device interface where we pass a matrix to a function, we often
find ourselves making a local copy of the matrix so we can concatenate
other transforms to it. This copying is a lot of unnecessary busywork
that I hope to eventually avoid by laying the groundwork with this
commit.
This is a rather large API change, so I apologize for the inconvenience,
but I hope the end result and gain in legibility will be worth the pain.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
* Trigger correctly on AS state changes.
* Handle the case when there is no AP (such as for unchecked checkboxes):
- Don't try to create Widget/Btn streams.
- Don't flag/unflag when AP synthesis throws.
|