summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-12-13Bug 693487: fix error handling in doc/multi-threaded.cRobin Watts
A user (av1474) points out that pthread error codes are non zero, not negative; hence fix the example code to test for these correctly.
2012-12-13Bug 693463: TR2 is defined for gstates, not for SMasks.Robin Watts
Move the TR2 handling code. Thanks to zeniko for this.
2012-12-13Bug 693290: Potential NULL deref in xpsRobin Watts
Another fix from zeniko. Thanks again.
2012-12-13Bug 693290: PNG image fuzzing issues.Robin Watts
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.
2012-12-13Bug 693290: Fix use after free in obj stream handling.Robin Watts
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.
2012-12-13Bug 693290: PDF cmap range warningsRobin Watts
Thanks to zeniko for these.
2012-12-13Android: add hooks to the app to handle GoToR linksPaul Gardiner
2012-12-13Forms: refactor form resetPaul Gardiner
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.
2012-12-12Fix use of text_bbox with pattern filled text.Robin Watts
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.
2012-12-12Fix fz_try/fz_catch in overflow case.Robin Watts
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.
2012-12-12Fix whitespace.Robin Watts
Thanks to zeniko for the heads up.
2012-12-09Rejig color conversion.Robin Watts
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.
2012-12-08Fix blend.ai.pdf - Missing "exclusion" textRobin Watts
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.
2012-12-08Bug 693290: Missed line from earlier patch causing SEGV.Robin Watts
A NULL pointer dereference could be caused in error cases due to me failing to apply zenikos patch correctly.
2012-12-08Optimise sharp scan conversion as we did with aa scan conversion.Robin Watts
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.
2012-12-08ios: Add button to highlight links.Tor Andersson
2012-12-08ios: Use fz_document interface directly.Tor Andersson
2012-12-08ios: Use setRootViewController instead of addSubview.Tor Andersson
Fixes warning at launch and autorotation not working on iOS 6.
2012-12-05Android: fix opening the wrong document from the file pickerPaul Gardiner
Sort the file list rather than the list adapter, so that the onclick position can validly be used to index the file list
2012-12-05Android: rework link handlingPaul Gardiner
Remove unnecessary hitPageLink method from MuPDFCore and extend the handling of external links to the java classes
2012-12-04Android: allow app to be moved to sd cardPaul Gardiner
2012-12-03Tweak fz_try/fz_always/fz_catch to handle throws from within always.Robin Watts
Throwing from within the always block is bad practice, but attempt to cope with it gracefully.
2012-12-03Fix potential infinite loop in jpeg error handling code.Robin Watts
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.
2012-11-30Rejig VS projects to avoid compiling files twice.Robin Watts
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.
2012-11-30Bug 693290: Harden pdf interpreter.Robin Watts
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.
2012-11-30Bug 693290: Fix for potential infinite recursion reading xrefs.Robin Watts
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.
2012-11-30Bug 693290: Various fixes found from fuzzing.Robin Watts
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
2012-11-29Android: sort file names in the file chooserPaul Gardiner
Also remove unnecessary initialisation of the adapter on creation
2012-11-29Fix a couple of leaksPaul Gardiner
2012-11-29Bug 693463: Various small fixes.Robin Watts
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.
2012-11-29Bug 693463: Fix various memory leaks.Robin Watts
All these leaks were spotted by zeniko, so credit/thanks to him.
2012-11-29Bug 693461: Add LL suffix to large number.Robin Watts
Only used in mujstest script generation.
2012-11-28Bug 693452: Memory leak with transitions disabled.Robin Watts
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.
2012-11-28Bug 693443: Don't check for fz_opts being NULL in pdf_write_documentRobin Watts
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.
2012-11-28Bug 693392: Add \n to some printfs in mujstest.Robin Watts
This stops all the warnings coming out on a single line.
2012-11-28Avoid calling interactive functions with a NULL idoc.Robin Watts
This solves the android build SEGVing on xps files such as ECMA-288.xps.
2012-11-28Remove .png from .gitignore since we have png files in the apps.Tor Andersson
2012-11-28Skip BOM in UTF-8 encdoded XML documents too.Tor Andersson
2012-11-28Android: fix null exception when viewing calc.pdfPaul Gardiner
2012-11-28Remove 2 unused variables.Robin Watts
2012-11-28Android: add support for listbox and combobox form fieldsPaul Gardiner
2012-11-28Android: Allow multiple instances of MuPDF to run simultaneously.Robin Watts
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).
2012-11-27Tweak image color conversionRobin Watts
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.
2012-11-27Update scan converter to cope better with rectangular paths.Robin Watts
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.
2012-11-27android: Use custom styles for widgets.Tor Andersson
2012-11-27android: Re-enable highlight button and use tinting for button states.Tor Andersson
2012-11-27android: Use fullscreen activities for page and outline views.Tor Andersson
2012-11-27android: Update cancel icon to be the same size as the other icons.Tor Andersson
2012-11-27ios: Add xcode project temp files to .gitignore.Tor Andersson
2012-11-27Skip BOM in XML parser which was confusing the XPS parser.Tor Andersson
The BOM was erroneously being emitted as a text node.