From 444e7524b62d553bd2e554428a290ece9b1de89c Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Fri, 8 Dec 2017 11:48:11 +0000 Subject: Fix SEGV in redaction code due to TJ with no chars. If the first TJ we meet in a file has an adjustment, but no chars, then we end up calling 'adjustment' without ever having set fontdesc. This causes a crash. Fix it here. --- source/pdf/pdf-op-filter.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source') diff --git a/source/pdf/pdf-op-filter.c b/source/pdf/pdf-op-filter.c index c3f64b3f..ef8aa8be 100644 --- a/source/pdf/pdf-op-filter.c +++ b/source/pdf/pdf-op-filter.c @@ -588,6 +588,7 @@ filter_show_text(fz_context *ctx, pdf_filter_processor *p, pdf_obj *text) if (!pdf_is_array(ctx, text)) return; + p->tos.fontdesc = fontdesc; n = pdf_array_len(ctx, text); skip.x = skip.y = 0; doc = pdf_get_bound_document(ctx, text); -- cgit v1.2.3