From 5f75285d8cadcc35e51f84bdbbffd6d0abdab6d5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 28 Mar 2017 16:21:32 +0200 Subject: pdf: Swallow unrecoverable errors and ignore rest of page. --- source/pdf/pdf-interpret.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/pdf/pdf-interpret.c') diff --git a/source/pdf/pdf-interpret.c b/source/pdf/pdf-interpret.c index 5d8e6025..8d2f6c57 100644 --- a/source/pdf/pdf-interpret.c +++ b/source/pdf/pdf-interpret.c @@ -993,7 +993,8 @@ pdf_process_stream(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, fz_stream else { cookie->errors++; - fz_rethrow(ctx); + fz_warn(ctx, "unrecoverable error; ignoring rest of page"); + tok = PDF_TOK_EOF; } } else @@ -1011,7 +1012,10 @@ pdf_process_stream(fz_context *ctx, pdf_processor *proc, pdf_csi *csi, fz_stream } } else - fz_rethrow(ctx); + { + fz_warn(ctx, "unrecoverable error; ignoring rest of page"); + tok = PDF_TOK_EOF; + } } /* If we do catch an error, then reset ourselves to a base lexing state */ -- cgit v1.2.3