diff options
author | Chris Liddell <chris.liddell@artifex.com> | 2022-08-22 08:29:33 +0100 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2022-08-22 08:55:05 +0100 |
commit | 3fb2d786b42c494d41bb3a0de0b1224f83dfbcd9 (patch) | |
tree | 87355aa54f22cb544d18e218a2863f4526bee30f /freetype | |
parent | aa7d24f2ce528d10970454c48d0a4e1870f95695 (diff) | |
download | ghostpdl-3fb2d786b42c494d41bb3a0de0b1224f83dfbcd9.tar.gz |
oss-fuzz 50057: freetype: [base, type1] Better handling of out-of-memory situations.
Committed upstream:
https://gitlab.freedesktop.org/freetype/freetype/-/commit/37b718d5899bc4a85425fcc548a7636871808f96
Diffstat (limited to 'freetype')
-rw-r--r-- | freetype/src/base/ftobjs.c | 3 | ||||
-rw-r--r-- | freetype/src/type1/t1objs.c | 4 |
2 files changed, 5 insertions, 2 deletions
diff --git a/freetype/src/base/ftobjs.c b/freetype/src/base/ftobjs.c index eeda69c3e..5eb4122a2 100644 --- a/freetype/src/base/ftobjs.c +++ b/freetype/src/base/ftobjs.c @@ -632,7 +632,8 @@ if ( slot->face->face_flags & FT_FACE_FLAG_SVG ) { /* free memory in case SVG was there */ - if ( slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG ) + /* `slot->internal` might be NULL in out-of-memory situations. */ + if ( slot->internal && slot->internal->flags & FT_GLYPH_OWN_GZIP_SVG ) { FT_SVG_Document doc = (FT_SVG_Document)slot->other; diff --git a/freetype/src/type1/t1objs.c b/freetype/src/type1/t1objs.c index 847ae0e64..fa4a13b53 100644 --- a/freetype/src/type1/t1objs.c +++ b/freetype/src/type1/t1objs.c @@ -146,7 +146,9 @@ FT_LOCAL_DEF( void ) T1_GlyphSlot_Done( FT_GlyphSlot slot ) { - slot->internal->glyph_hints = NULL; + /* `slot->internal` might be NULL in out-of-memory situations. */ + if ( slot->internal ) + slot->internal->glyph_hints = NULL; } |