summaryrefslogtreecommitdiff
path: root/pdf/pdf_page.c
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2022-01-18 12:50:15 +0000
committerChris Liddell <chris.liddell@artifex.com>2022-01-18 16:16:41 +0000
commita1f3fb482e257c3b52e470146ec4f9abd51e2ddd (patch)
treec044f45c9f03ca11f3e7e813b7c5c01ab6cdd754 /pdf/pdf_page.c
parent781d69de03e183ea3135a1931911325b6578ef10 (diff)
downloadghostpdl-a1f3fb482e257c3b52e470146ec4f9abd51e2ddd.tar.gz
oss-fuzz 43615: Keep a reference to the current pdfi font
in the pdfi graphics state. Previously, we relied on pdfi_gsave/pdfi_grestore to keep the reference count correct for pdfi font from which the current gs_font in the graphics state is derived. This was, at best, a compromised approach, since it meant the lifespan of the font object was not directly tied to the graphics state which referenced it. We opted for this because, at the time, we wanted to avoid the upheaval of implementing a pdfi specific graphics state. That approach also couldn't account for graphics state copies created and destroyed by means other than gs_gsave/gs_grestore - such as saving the graphics state for subsequent use when evaluating an SMask group. Subsequently, other requirements made it clear a pdfi specific graphics state was absolutely required. As such, it makes sense to store a reference to the current (pdfi) font in the pdfi graphics state and, since the pdfi graphics state lifespan is tied to the gs_gstate lifespan, thus we can now connect the font objects' reference count to the graphics state(s) that refernce them.
Diffstat (limited to 'pdf/pdf_page.c')
-rw-r--r--pdf/pdf_page.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c
index aed1eeef6..95ed84a02 100644
--- a/pdf/pdf_page.c
+++ b/pdf/pdf_page.c
@@ -26,6 +26,7 @@
#include "pdf_loop_detect.h"
#include "pdf_colour.h"
#include "pdf_trans.h"
+#include "pdf_font_types.h"
#include "pdf_gstate.h"
#include "pdf_misc.h"
#include "pdf_optcontent.h"