summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2011-12-08Fix exception handling in pdfdraw to avoid leaks.Robin Watts
Remove use of 'die', in place of proper exception handling.
2011-12-08Move from volatile to fz_var.Robin Watts
When using exceptions (which are implemented using setjmp/longjmp), we need to be careful to ensure that variable values get written back before any exception happens. Previously we've done that using volatile, but that produces nasty warnings (and unduly limits the compilers freedom to optimise). Here we introduce a new macro fz_var that passes the address of the variable out of scope. This means that the compiler has to ensure that any changes to its value are written back to memory before calling any out of scope function.
2011-12-08Fix regression from main; no "invalid password" errorRobin Watts
In converting from error return to exception throwing I was over enthusiatic and removed more than I should. Add missing code back in. Problem was seen with "0 - password password (crypt level 5).pdf"
2011-12-08Fix SEGV with "1439 - color softmask fails to draw jpx image.pdf"Robin Watts
Another missed fz_rethrow. Also, ensure that fz_drop_buffer copes with NULL input.
2011-12-08Fix lack of output with "719 - EOF incorrectly detected.pdf"Robin Watts
When converting to exception handling I'd messed up an error handling case; when failing to pdf_lex in pdf_repair_xref I had allowed the error to just carry on being thrown rather than catching it and cleaning up. This was resulting in not getting any output for the above file, rather than outputting as much as we could. Simple fix.
2011-12-08Fix possible NULL dereference in pdf_resolve_indirectRobin Watts
The code was dereferencing xref to get ctx before checking whether it was NULL or not. Simple fix to move the test up a bit.
2011-12-08Fix SEGV seen when repairing SumatraPDF1.1DOS.pdfRobin Watts
An error while parsing pdf_parse_array could result in double dropping of an object. Simple fix.
2011-12-08Merge branch 'master' into contextRobin Watts
2011-12-08Round instead of truncate when converting reals to ints in fz_to_int.Tor Andersson
2011-12-08Ignore invalid color key Masks that contain non-integer values.Tor Andersson
2011-12-08Undo pre-multiplied alpha when saving PNG with alpha channels.Tor Andersson
2011-12-07Fix tile coverage calculations.Robin Watts
The code attempts to spot cases where a pattern tile is so large that only 1 repeat is visible. Due to rounding errors, this test could sometimes fail, and (on badly formed files) we'd attempt to allocate huge pixmaps. The fix is to allow for rounding errors.
2011-12-07Fix tile coverage calculations.Robin Watts
The code attempts to spot cases where a pattern tile is so large that only 1 repeat is visible. Due to rounding errors, this test could sometimes fail, and (on badly formed files) we'd attempt to allocate huge pixmaps. The fix is to allow for rounding errors.
2011-12-07Fix fz_close to cope with NULL.Robin Watts
Destructors should accept NULL. This was being tripped in the cleanup code if a file did not exist.
2011-12-07Fix mismerge, causing error on closedown of mupdf.exe.Robin Watts
At some point I'd mismerged some code for handling app->doctitle, resulting in app->doctitle pointing to something that's not a heap block. This caused an error when app->doctitle was freed at closedown. Remove the offending code and all is well.
2011-12-06Remove dead (duplicated) code from pdf_fontfile.cRobin Watts
2 if clauses were (harmlessly) duplicated in pdf_find_builtin_font, probably due to an automated code merge (or other cut/paste error).
2011-12-06Remove dead (duplicated) code from pdf_fontfile.cRobin Watts
2 if clauses were (harmlessly) duplicated in pdf_find_builtin_font, probably due to an automated code merge (or other cut/paste error).
2011-12-06Move antialias levels into context.Robin Watts
In builds that support configurable layers of antialiasing, move the variables that control this into the context. This makes it possible to safely use different levels of antialiasing in different threads.
2011-11-28Move Freetype globals into context.Robin Watts
Freetype globals are not shared between threads currently - to do that we'll need to introduce a lock.
2011-11-25Merge branch 'master' into contextRobin Watts
2011-11-25First cut at support for OCGs in mupdf (bug 692314)Robin Watts
When opening a file, create a pdf_ocg_descriptor that lists the OCGs in a file. Add a new function to allow us to set the configuration in use (currently just the default one). This sets the states of the OCGs as appropriate. When decoding the file respect the states of the OCGs. This results in Invite.pdf rendering correctly. There is more to be done in this area (with automatic setting of OCGs by language/zoom level etc), but this is a good start.
2011-11-24Fix *STUPID* error in recent clipping changes.Robin Watts
Once we've applied the clipping path, don't clip again on every subsequent path.
2011-11-24Prepare for App Store release.Tor Andersson
2011-11-24Resize searchBar manually instead of relying on automatic resizing.Tor Andersson
2011-11-24Bug 692506: Improve repairing by accepting broken dictionaries.Robin Watts
Adopt Zenikos patch from bug 692506; if a dict fails to parse, then create an empty one and continue. The repaired document will be incomplete, but we may well get something useful out of it.
2011-11-22Add password dialog to iOS app.Tor Andersson
2011-11-22Fix memory leaks in iOS app.Tor Andersson
The use of a set for visible pages was causing reference counting cycles. viewDidUnload is only called in low memory warning situations, not as part of the normal tear down.
2011-11-22Tweak search UI and use iOS 5 features for better toolbar buttons.Tor Andersson
2011-11-22Update About document and fix some search UI bugs in iOS app.Tor Andersson
2011-11-22Display search results and search in background thread.Tor Andersson
2011-11-22Add search buttons and search bar to iOS app.Tor Andersson
2011-11-22Add searching to the high level document API in the iOS app.Tor Andersson
2011-11-22Fix bug where app->doctitle wasn't pointing to an alloced string.Tor Andersson
2011-11-17Bug 692424: make repair cope better with missing endobjRobin Watts
Previously when parsing an object with a missing endobj, the code would consume the header of the following object. Here we amend the code to give up searching for an endobj if it finds an integer (presumed to be the start of the next object). We backtrack over that integer and carry on.
2011-11-17Bug 692478: Honour decode arrays for jpx imagesRobin Watts
Add simple code to read decode array and apply it to a jpx image after loading. Solves bug.
2011-11-17Bug 692487: Make pdfclean keep internal links where possible.Robin Watts
Take on a (cosmetically tweaked) version of Zenikos patch to allow pdfclean to keep link destinations that are in preserved pages.
2011-11-17Fix bug 692627; pdfclean -ggg of encrypted files fails.Robin Watts
Encryption bakes the object numbers into the strings/streams. This means that our renumbering technique falls down; when we move an object to its new position, then come to read it, we find that it decrypts badly. The fix here is (as suggested by Zeniko) to avoid renumbering when encryption is in use.
2011-11-17AES encryption tweak; strings can be 0 bytes longRobin Watts
Do not emit a warning if AES strings are 0 bytes long.
2011-11-17Fix bug 692627: stack overflows in text handling.Robin Watts
The existing code uses recursion for text span handling. With sufficiently many chained spans we get stack overflow. Simple fixes to use a loop.
2011-11-15Allow draw device to use a dynamic stack.Robin Watts
Previously, we had a hardwired 96 element stack for clipping/group nesting etc. If this was exceeeded during rendering we would give an error. Now we allow for that stack to be extended dynamically at runtime. If the stack extension fails, we will give an error and die.
2011-11-15Fix clipping error.Robin Watts
When reverting the clip path handling, I made a mistake. We need to set up the clip before starting any local group to ensure correct nesting.
2011-11-15Fix clipping error.Robin Watts
When reverting the clip path handling, I made a mistake. We need to set up the clip before starting any local group to ensure correct nesting.
2011-11-15Error, don't crash on file not found.Robin Watts
Throw an error rather than returning NULL from fz_open_file.
2011-11-15Merge branch 'master' into contextRobin Watts
Mostly redoing the xps_context to xps_document change and adding contexts to newly written code. Conflicts: apps/pdfapp.c apps/pdfapp.h apps/x11_main.c apps/xpsdraw.c draw/draw_device.c draw/draw_scale.c fitz/base_object.c fitz/fitz.h pdf/mupdf.h pdf/pdf_interpret.c pdf/pdf_outline.c pdf/pdf_page.c xps/muxps.h xps/xps_doc.c xps/xps_xml.c
2011-11-14Simplify fz_try/fz_catch by removing failed flag.Robin Watts
The failed flag can be removed by having the fz_throw (and fz_rethrow) functions do the popping of the stack.
2011-11-14Squash 3 'const' warnings.Robin Watts
3 functions were defined as taking a const unsigned, but declared as taking an unsigned. Fixed here.
2011-11-14mupdf clip path handling; revert commit 2f8acb0Robin Watts
In commit 2f8acb0, we tweaked mupdf's clip path handling so that clip paths were resolved as soon as the operator for them was called; this protected against subsequent changes to the path happening before something else was drawn ready for clipping. Unfortunately, various PDF files out there seem to rely on the fact that they can call the 'W' operator before fully defining the path, and that the region that will be clipped is given by the final path, not the one that was in place when the operator was called. We therefore revert back to the old behaviour.
2011-11-14Grid fitting tweaks.Robin Watts
Extract the grid fitting code from the scaling code and the affine image drawing code into it's own separate function. This reduces code duplication. It also allows us to make better allowance for rounding errors. Add a voodoo offset in the draw_affine.c code for painting interpolated images. This gives us the best possible match between all the different combinations of scaled/unscaled and interpolated/uninterpolated images.
2011-11-14Fix libmupdf.vcproj breakage.Robin Watts
Missing </File> entry.
2011-11-14Add 'simple scale' variant of scaling routines.Robin Watts
draw_simple_scale.c is a cut down version of draw_scale.c, that only uses filter functions that return values strictly in the 0 to 1 range. Because of that, we can use bytes rather than ints as intermediate storage, and have no clipping to do.