diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-02-21 10:18:52 +0000 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-02-21 11:28:05 +0000 |
commit | c8051ae666672cb7ca39531e28ec85636e1ce6d5 (patch) | |
tree | 7564cada29831d87177f0496a12da11daada59b1 | |
parent | 55204831fe58540c6e573e9fa63f1a30a0fb83cb (diff) | |
download | ghostpdl-c8051ae666672cb7ca39531e28ec85636e1ce6d5.tar.gz |
oss-fuzz 44855: Don't ignore Freetype error code
In one of the "in extremis" fallback cases, the return code from Freetype
wasn't being acted upon, leaving a partially initialised glyph bitmap, that we
subsequently attempt to use, resulting in a crash.
-rw-r--r-- | base/fapi_ft.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/base/fapi_ft.c b/base/fapi_ft.c index b4111993a..f02018eca 100644 --- a/base/fapi_ft.c +++ b/base/fapi_ft.c @@ -810,6 +810,10 @@ load_glyph(gs_fapi_server * a_server, gs_fapi_font * a_fapi_font, FT_Render_Mode mode = FT_RENDER_MODE_MONO; ft_error = FT_Render_Glyph(ft_face->glyph, mode); + if (ft_error != 0) { + (*a_glyph) = NULL; + return (gs_error_VMerror); + } } else { (*a_glyph) = NULL; |