shithub: neatpost

Download patch

ref: b42609caa2a9a86004731c353e516673374d6d0e
parent: 0d5c130f06187d85e1eb6387c79bfd89888fb738
author: Ali Gholami Rudi <ali@rudi.ir>
date: Sun Jun 3 20:34:30 EDT 2018

pdf: fix removing the fixed content portion of Type 1 fonts

Reported by Nils Reuße <n.reusse@hxgn.net>.

--- a/pdf.c
+++ b/pdf.c
@@ -112,6 +112,7 @@
 			fixedcont = t1 + i;
 	*l1 = encrypted - cleartext;
 	*l2 = fixedcont ? fixedcont - cleartext : 0;
+	*l3 = fixedcont ? t1 + l - fixedcont : 0;
 	return 0;
 }
 
@@ -241,6 +242,7 @@
 			if (l3)
 				sbuf_cut(ffsb, l1 + l2);
 			l1 -= l3;
+			l3 = 0;
 		}
 		/* encoding file contents */
 		encodehex(sb, sbuf_buf(ffsb), sbuf_len(ffsb));