Skip to content

Commit

Permalink
Fix SEGV in redaction code due to TJ with no chars.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
robinwatts committed Dec 8, 2017
1 parent 61f4665 commit 444e752
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions source/pdf/pdf-op-filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 444e752

Please sign in to comment.