Bug 706147: Fix text positioning error in filter processor.
authorRobin Watts <[email protected]>
Wed, 11 Jan 2023 19:13:34 +0000 (19:13 +0000)
committerJulian Smith <[email protected]>
Thu, 26 Jan 2023 11:10:56 +0000 (11:10 +0000)
When filtering, we were failing to reset the stored pending Td
values when we hit a BT. This meant that when we elide a Td
(perhaps due to redaction), we'd incorrectly add the stored
offset onto the next one.

source/pdf/pdf-op-filter.c

index e5d5411a6432accb51a240b5754cd5c5bbc64e0d..a7867a8b6c4a3797d583d1327dcc86bc49ccbc8b 100644 (file)
@@ -1499,6 +1499,8 @@ pdf_filter_BT(fz_context *ctx, pdf_processor *proc)
        p->BT_pending = 1;
        p->text_sent = 0;
        p->text_removed = 0;
+       p->Td_pending = 0;
+       p->Td_value.x = p->Td_value.y = 0;
 }
 
 static void