summaryrefslogtreecommitdiff
path: root/source/fitz/document.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/document.c')
-rw-r--r--source/fitz/document.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/source/fitz/document.c b/source/fitz/document.c
index 45da7e90..4bde820c 100644
--- a/source/fitz/document.c
+++ b/source/fitz/document.c
@@ -244,14 +244,38 @@ void
fz_run_page_contents(fz_document *doc, fz_page *page, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie)
{
if (doc && doc->run_page_contents && page)
- doc->run_page_contents(doc, page, dev, transform, cookie);
+ {
+ fz_context *ctx = dev->ctx;
+
+ fz_try(ctx)
+ {
+ doc->run_page_contents(doc, page, dev, transform, cookie);
+ }
+ fz_catch(ctx)
+ {
+ if (fz_caught(ctx) != FZ_ERROR_ABORT)
+ fz_rethrow(ctx);
+ }
+ }
}
void
fz_run_annot(fz_document *doc, fz_page *page, fz_annot *annot, fz_device *dev, const fz_matrix *transform, fz_cookie *cookie)
{
if (doc && doc->run_annot && page && annot)
- doc->run_annot(doc, page, annot, dev, transform, cookie);
+ {
+ fz_context *ctx = dev->ctx;
+
+ fz_try(ctx)
+ {
+ doc->run_annot(doc, page, annot, dev, transform, cookie);
+ }
+ fz_catch(ctx)
+ {
+ if (fz_caught(ctx) != FZ_ERROR_ABORT)
+ fz_rethrow(ctx);
+ }
+ }
}
void