Age | Commit message (Collapse) | Author |
|
A user (av1474) points out that pthread error codes are non zero,
not negative; hence fix the example code to test for these
correctly.
|
|
Move the TR2 handling code. Thanks to zeniko for this.
|
|
Another fix from zeniko. Thanks again.
|
|
The issues fixed here were found by zeniko - many thanks.
The patch here is our own work - larger change, avoiding casts
for a (hopefully) neater result.
|
|
Thanks to zeniko for pointing this out. If we encounter a new definition
for a given object (presumably due to a repair operation), we used to
throw the old one away, and keep the new one. This could cause any
current holders of the object to be left with a stale pointer.
Now we throw the new one away and keep the old one - with a warning
if they are different.
|
|
Thanks to zeniko for these.
|
|
|
|
The way the forms to be reset is specified is used also in form
submission. This commit pulls out that selection method as a
separate function that returns the set of affected forms as a
pdf array object.
|
|
Following on from the blend.ai.pdf disapparing text fix that went in
the other day, zeniko has pointed out that we should be using the
device space on entry to pdf_show_pattern too. Fixed here.
Many thanks.
|
|
Thanks to zeniko for pointing out that the recent changes to
the fz_try/fz_catch macros to allow for throws in the fz_always
block had broken the exception stack overflow case.
Thanks also for the example file (nesting stack overflow.pdf),
which has now been added to the regression suite.
|
|
Thanks to zeniko for the heads up.
|
|
Add a mechanism for getting a color converter function. Implement
the 'convert a single color' call in terms of that. 'Bulk' users
can then repeatedly call the single function.
|
|
When creating a group around text, the text bbox was being used as the
group bbox without transforming it. This results in missing text in
blends.
Various text sections are now appearing in some test files too.
|
|
A NULL pointer dereference could be caused in error cases due
to me failing to apply zenikos patch correctly.
|
|
In doing this work, it strikes me that there is an unoptimised case
left in the aa scan conversion; when we are plotting whole scanlines
with gel->alen = 0, we can skip the entire blit. This happens
relatively rarely so the extra cost of the test may be more than
is worthwhile.
|
|
|
|
|
|
Fixes warning at launch and autorotation not working on iOS 6.
|
|
Sort the file list rather than the list adapter, so that
the onclick position can validly be used to index the file list
|
|
Remove unnecessary hitPageLink method from MuPDFCore and extend the
handling of external links to the java classes
|
|
|
|
Throwing from within the always block is bad practice, but attempt
to cope with it gracefully.
|
|
Turns out that jpeg_finish_decompress can throw errors, hence
can cause an infinite loop. This is fixed here by changing the
jpeg error code to be fz_throw based.
Thanks to zeniko for this patch.
This highlights something that I hadn't fully appreciated before;
anything that throws in a fz_always region will reenter that region.
I think I have a way to fix this so that any throws in the
fz_always region go immediately to the fz_catch.
|
|
We now have a libmupdf that has all the usual files in, plus a
libmupdf-v8 and a libmupdf-nov8 with/without javascript
respectively. libmupdf-v8 and libmupdf-nov8 both depend on libmupdf,
and the apps depend on libmupdf-{no,}v8 as appropriate.
This means every file is listed (and compiled) strictly once, and
better matches the style of the unix builds. It also prevents VS
getting confused and listing files twice in search results.
Also, we strip out the unnecessary repeated calls to generate.bat,
which result in occasional spurious build failures.
|
|
Various changes from zeniko to make the pdf interpreter cope better
with malformed files.
When running subobjects, catch the thrown errors to avoid upsetting
the clip stack.
When running a content stream, ensure that we don't underflow the
graphics states (in case of mismatched q/Q's). Here our patch
differs slightly from zeniko's original, as we pop any extra
ones off before returning.
|
|
Fix an issue spotted by zeniko. The patch is slightly modified
from his supplied one to avoid problems with repeated freeing
of the buffer, and to avoid abusing fz_buffer, but is largely
based on his work.
Many thanks.
|
|
Thanks to zeniko for finding various problems and submitting a
patch that fixes them. This commit covers the simpler issues from
his patch; other commits will follow shortly.
* Out of range LZW codes.
* Buffer overflows and error handling in image_jpeg.c
* Buffer overflows in tiff handling
* buffer overflows in cmap parsing.
* Potential double free in font handling.
* Buffer overflow in pdf_form.c
* use of uninitialised value in error case in pdf_image.c
* NULL pointer dereference in xps_outline.c
|
|
Also remove unnecessary initialisation of the adapter on creation
|
|
|
|
Thanks to zeniko for these.
Use otf as extension for opentype fonts.
fz_clampi should take ints, not floats!
Fix typo in prototype.
Squash unwanted warning.
Remove magic number in favour of #define.
Reset generation numbers when renumbering.
|
|
All these leaks were spotted by zeniko, so credit/thanks to him.
|
|
Only used in mujstest script generation.
|
|
Since adding transition support any page turn has leaked a bitmap
image. Don't save the old image unless we are really in transition
mode.
|
|
Moritz Lipp points out that the check for opts being NULL in
pdf_write_document is unnecessary. Removing it brings the
function into line with the docs.
|
|
This stops all the warnings coming out on a single line.
|
|
This solves the android build SEGVing on xps files such as
ECMA-288.xps.
|
|
|
|
|
|
|
|
|
|
|
|
Previously, we had assumed that we'd only ever have one MuPDFActivity
running at once; this meant that we only had a single MuPDFCore, and
that it was safe to hold the native libraries state in global
variables.
Unfortunately, it seems that if you launch MuPDF from the apps list,
and open a file, then return to the home screen using 'Home' rather than
'Back', MuPDF is kept running in the background. Launching a PDF file
from a file manager then starts a new MuPDFActivity and things get
very confused.
The solution implemented here is first to move all the MuPDF global
variables into a 'globals' structure, and update the code to use
this. Next, we allocate this structure on 'openFile', and free it on
'destroying'. Finally, we return the pointer to this structure as a
java long from openFile, and store it in a private data pointer,
globals.
Each MuPDFCore native method can then retrieve the value of 'globals'
and get the global state back. This means that every MuPDFCore native
method must now be non-static (except isJavascriptSupported).
|
|
Use just 1 loop rather than 2, and count downwards as this is faster
on most architectures.
For the 'hash tabled memoized' general case, the time taken to form the
hashes is significant. Add some code to check that the pixel isn't the
same as the one we just did and bypass the hash.
|
|
Currently the scan converter advances one 'subpixel' scanline at a
time; here we update it to work in multiple subpixel scanlines at a
time.
If we spot that the gel consists of entirely vertical edges, then we
calculate the height for which those edges will remain unchanged. This
allows us to deal quickly with rectangular paths.
In the case of large vertical only edges, we can process multiple
scanlines (not just subpixel scanlines) at once.
|
|
|
|
|
|
|
|
|
|
|
|
The BOM was erroneously being emitted as a text node.
|