[gs-commits] mupdf 1.16.1.18 Fix matrix multiplication order in text f

[email protected] (Tor Andersson)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
commit b20d0ccc769b2956846da9862697e980457e517f
Author: Tor Andersson <[email protected]>
Date:   Wed Aug 21 17:44:18 2019 +0200

    Fix matrix multiplication order in text filtering.
    
    The sent.ctm matrix is maintained only for text filtering,
    but the matrix concatenation order was inverted leading to
    erroneous redaction results in the redaction filter.

diff --git a/source/pdf/pdf-op-filter.c b/source/pdf/pdf-op-filter.c
index 25c0d57..788e183 100644
--- a/source/pdf/pdf-op-filter.c
+++ b/source/pdf/pdf-op-filter.c
@@ -228,7 +228,7 @@ static void filter_flush(fz_context *ctx, pdf_filter_processor *p, int flush)
 					gstate->pending.ctm.e,
 					gstate->pending.ctm.f);
 
-			gstate->sent.ctm = fz_concat(current, gstate->pending.ctm);
+			gstate->sent.ctm = fz_concat(gstate->pending.ctm, current);
 			gstate->pending.ctm.a = 1;
 			gstate->pending.ctm.b = 0;
 			gstate->pending.ctm.c = 0;
@@ -503,7 +503,7 @@ filter_show_char(fz_context *ctx, pdf_filter_processor *p, int cid, int *unicode
 
 	if (p->text_filter)
 	{
-		fz_matrix ctm = fz_concat(gstate->sent.ctm, gstate->pending.ctm);
+		fz_matrix ctm = fz_concat(gstate->pending.ctm, gstate->sent.ctm);
 		fz_rect bbox;
 
 		if (fontdesc->wmode == 0)
@@ -1265,7 +1265,7 @@ pdf_filter_ET(fz_context *ctx, pdf_processor *proc)
 	p->BT_pending = 0;
 	if (p->after_text)
 	{
-		fz_matrix ctm = fz_concat(p->gstate->sent.ctm, p->gstate->pending.ctm);
+		fz_matrix ctm = fz_concat(p->gstate->pending.ctm, p->gstate->sent.ctm);
 		if (p->chain->op_q)
 			p->chain->op_q(ctx, p->chain);
 		p->after_text(ctx, p->opaque, p->doc, p->chain, ctm);

http://git.ghostscript.com/?p=mupdf.git;a=commit;h=b20d0ccc769b2956846da9862697e980457e517f

--
MuPDF library
Artifex Software, Inc.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.