summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2012-01-06pdf_repair tweaks; fail in fewer cases.Robin Watts
When repairing, if we hit a problem after having found a root object live with that root object rather than giving up completely. Also fix a memory leak, and cope better with trailing crap. Thanks to Zeniko for these.
2012-01-06Catch errors with impossibly wide images.Robin Watts
Thanks to Zeniko for pointing this out.
2012-01-06Clamp pixel values after applying Decode array to images.Robin Watts
Thanks to Zeniko for pointing this out.
2012-01-06Ignore decode arrays for indexed jpx images.Robin Watts
We can't do them properly at the moment, so don't try to do them at all - only makes stuff worse for now. Thanks to Zeniko for this.
2012-01-06Fix xps tiff context problem.Robin Watts
Exactly parallel to the png problem fixed a few days ago. Thanks to Zeniko for pointing this out.
2012-01-06Various memory leak fixes.Robin Watts
In error cases, ensure we free objects correctly. Thanks to Zeniko for finding the problems (and many of the solutions!)
2012-01-06Add 'marking' functions for dictionaries.Robin Watts
In various places in the code, we add markers (".seen") to dictionaries as we traverse them to ensure that we don't go into infinite loops. Adding a dictionary entry is bad as it's a) an expensive operation, b) a potentially destructive one, and c) produces another possible point of failure (as mallocs can fail). Instead, add a flag to each dict to allow them to be marked/unmarked and use that instead. Thanks to Zeniko for pointing out various places that could usefully be protected against infinite recursion.
2012-01-06fz_free_link_dest; fix a memory leakRobin Watts
Externalise free_link_dest, use it in doc_outline.c to avoid a memory leak. Thanks to again to Zeniko for pointing this out.
2012-01-06draw_device; device state stack handling fixes.Robin Watts
Only create a shape if we need to. Correctly cleanup, thus avoiding a double free of mask later on. Thanks to Zeniko for spotting these.
2012-01-06pdfshow; cope better with broken objectsRobin Watts
In pdfshow, if we fail to parse an object, just skip it rather than aborting. Thanks to Zeniko for the suggestion.
2012-01-06pdfclean; trailer dictionary expansion fixRobin Watts
The logic controlling whether to expand a trailer dictionary or not was reversed. Fixed here. Thanks to Zeniko for pointing this out.
2012-01-05Update iOS app to context branch.Tor Andersson
2012-01-05Remove stray semicolons and fix typo in xps zip code.Tor Andersson
2012-01-04Bug 692739: Add ability to abort time consuming actionsRobin Watts
A new 'cookie' parameter is added to page rendering/interpretation functions. Supply this as NULL to get existing behaviour. If you supply a non-NULL cookie, then this is taken as a pointer to a struct that can be used for simple, non-thread locked communication between caller and library. The entire struct should be memset to zero before entry, except for specific flags (thus coping with future extensions to this struct). The abort flag should be zero on entry. It will be checked periodically by the library - if the caller sets it non-zero (via another thread) then the current operation will be aborted. No guarantees are given as to how often this will be checked, or how fast it will be responded to. The progress_max field will be set to an integer (-1 for unknown) representing the number of 'things' to do. The progress field will count up from 0 to this number as time goes by. No guarantees are made as to the accuracy of this information, but it should be useful for offering some sort of progress bar etc. Note that progress_max may increase during the job. In general, callers should be careful to accept out of range or invalid data in this structure as this is deliberately accessed 'unlocked'.
2012-01-03Add mubusy buildRobin Watts
Add simple combined exe build for mupdf/muxps tools.
2012-01-03Rework draw device stack handling.Robin Watts
As we create clips/transparency groups etc, we maintain a stack of draw device states. Here we change this from having a 'current' state, and storing changes on the stack to always keeping the complete current state on the head of the stack. This should make error cleanup easier, as well as being conceptually easier to follow (for me at least).
2012-01-02Fix bug 692593 - solve crash due to inappropriately sized shape plane.Robin Watts
When starting to tile, create a shape plane if one exists. When finishing tiling, plot the shape plane back too. This solves the SEGVs. Something isn't quite right with the blending colours on part of this file though.
2012-01-02Bound shades by the supplied bbox.Robin Watts
Fix a 'TODO'. When asking for the bounds of a shading, simply convert the shadings bbox and intersect with that.
2011-12-30Load outlines in viewer after pages to allow links to work.Robin Watts
In order for hyperlinks to work, we need to load the outlines after the pages tree.
2011-12-30Enable knockout and non-isolated group support.Robin Watts
Testsseem to indicate that this works, and gives noticable improvements. Enabling by default.
2011-12-30Avoid SEGV when reading PNG from XPSRobin Watts
The xps png reading code was overwriting its context pointer with zero, then referencing through it.
2011-12-30Correct off by 1 error in outline handling.Robin Watts
When the page number is given by an int, rather than an indirect reference number in a link destination, the page number is already 0 based. Remove the adjustment that I'd been incorrectly doing.
2011-12-30Outline fixesRobin Watts
When reading an XYZ link destination, I was writing Z over X. While fixing this, change to cryptic enums rather than unexplained magic numbers. When reading the outlines out of a pdf file, better to actually store them in a linked list rather than just dropping them.
2011-12-30Fix typo in draw/draw_affine.c causing offsetting of shape planeRobin Watts
The shape plane was being incorrectly offset from the dest plane. This could have caused SEGVs or incorrect results when blending back. This solves the hivemind.pdf iphone being clipped on the right hand side.
2011-12-30Blending improvementsRobin Watts
More work on MuPDFs blending support. This seems to get l16.pdf working pretty well. Fuller testing required to know if we get everything right, but the maths now makes as much sense as it ever has to me, and seems to track what gs does (more or less, in that we don't use group alpha and gs does).
2011-12-28Silence warning in pdf_cmap_parse.cRobin Watts
2011-12-28Outline/link destination tweaks.Robin Watts
Move 'kind' into the fz_link_dest structure (as this makes more sense). Put an fz_link_dest rather than just a page number into the outlines structure. Correct parsing of actions and dests from pdf outlines.
2011-12-24Fix (part of) bug 69293 - typos in draw_affine for shape code.Robin Watts
As Zeniko correctly points out in bug 692593, I had incorrectly used hp[n1] when I should be using hp[0] at various points. Hopefully that bug should be solved in it's entirety now with the previous commit.
2011-12-24Bug 692489 - fix SEGV in non-isolated/knockout blendingRobin Watts
Restrict images to the size of the shape when blending back. This seems to solve the problem; leaving code disabled until full tests complete.
2011-12-24Don't forget to copy the link destination struct when creating a link.Tor Andersson
2011-12-23Remove stray error check. Optional functions in shadings are optional.Tor Andersson
2011-12-23Generalise pdf_links to be fz_links.Robin Watts
Move to a non-pdf specific type for links. PDF specific parsing is done in pdf_annots.c as before, but the essential type (and handling functions for that type) are in a new file fitz/base_link.c. The new type is more expressive than before; specifically all the possible PDF modes are expressable in it. Hopefully this should allow XPS links to be represented too.
2011-12-23Add some fz_vars to fix exception behaviour.Robin Watts
gcc 4.4.5 gives helpful warnings about variables that can become unset due to setjmp/longjmp usage. Fix that here. Thanks to Sebras.
2011-12-22Fix Bug 692756: SEGVs in pdf_annot and pdf_outlineRobin Watts
A couple of bits of the code SEGV in the event that values are NULL. Fixed here by converting a do...while to a while, and adding an extra guard in the if. Thanks to Gaetan Bisson for the report, and patch.
2011-12-22More MemSqueezing fixes.Robin Watts
2011-12-21Fix whitespace.Tor Andersson
2011-12-21Bring the Android demo port up to date.Robin Watts
Hadn't been updated to allow for context/exceptions.
2011-12-20More memsqueezing fixes.Robin Watts
One of the previous memsqueezing fixes (specifically that in close_dctd) appears to cause the Memento fork bases squeezing process to stop. This appears to be because old code would do a NULL dereference causing a SEGV. This would somehow NOT be picked up by the signal handler, and the child would exit. If the code is fixed to avoid the SEGV the code then somehow goes on to do something (not in the close_dctd code) that makes the mem squeeze process grind to a halt - but NOT in the same instance of the executable. I am at a loss to explain this, but would rather the code stays as it is (being as far as I can see correct) for now.
2011-12-19More memsqueezing fixes.Robin Watts
2011-12-19Add Memento 'pattern' code.Robin Watts
Disabled for now by default. Better SEGV handling under windows (to facilitate scripted squeezing)
2011-12-19More Memory squeezing fixesRobin Watts
2011-12-19Removed unused variable.Robin Watts
2011-12-17More memsqueezing fixes.Robin Watts
2011-12-17More Memory Squeezing fixes.Robin Watts
2011-12-17Memory squeezing fixRobin Watts
2011-12-17More memsqueezing fixes; stream creation.Robin Watts
2011-12-17Change stream 'close' functions to facilitate error cleanup.Robin Watts
Rather than passing a stream to a close function, just pass context and state - that's all that is required. This enables us to call close to cleanup neatly if the stream fails to allocate.
2011-12-16More memsqueezing fixes.Robin Watts
2011-12-16Increase amount to search in blocks for nestings in memento.Robin Watts
Mupdf has some large structures (fz_shade is over 32K!), so to catch all pointers we need to search further than the 1K I was originally limiting ourselves to.
2011-12-16More MemSqueezing fixes.Robin Watts