diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-01-18 12:50:15 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-01-18 16:16:41 +0000 |
commit | a1f3fb482e257c3b52e470146ec4f9abd51e2ddd (patch) | |
tree | c044f45c9f03ca11f3e7e813b7c5c01ab6cdd754 /pdf/pdf_shading.c | |
parent | 781d69de03e183ea3135a1931911325b6578ef10 (diff) | |
download | ghostpdl-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_shading.c')
-rw-r--r-- | pdf/pdf_shading.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pdf/pdf_shading.c b/pdf/pdf_shading.c index 2c888cdb4..845267784 100644 --- a/pdf/pdf_shading.c +++ b/pdf/pdf_shading.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2018-2021 Artifex Software, Inc. +/* Copyright (C) 2018-2022 Artifex Software, Inc. All Rights Reserved. This software is provided AS-IS with no warranty, either express or @@ -17,6 +17,7 @@ #include "pdf_int.h" #include "pdf_stack.h" +#include "pdf_font_types.h" #include "pdf_gstate.h" #include "pdf_shading.h" #include "pdf_dict.h" |