diff options
author | Werner Lemberg <wl@gnu.org> | 2017-03-31 09:35:58 +0200 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2017-03-31 09:35:58 +0200 |
commit | 5a3490e054bda8a318ebde482c7fb30213cab3d9 (patch) | |
tree | 5ae711d435a4be02421610ce871990786427de9a /src | |
parent | c8c6763988ebc4ce1c93c099ae2401b677035c60 (diff) | |
download | freetype2-5a3490e054bda8a318ebde482c7fb30213cab3d9.tar.gz |
* src/cff/cffload.c (cff_font_load): Improve fix from 2017-01-04.
Allow CFFs containing a single font to have an empty font name.
Problem reported by 張俊芝 <418092625@qq.com> in
http://lists.nongnu.org/archive/html/freetype-devel/2017-03/msg00074.html
Diffstat (limited to 'src')
-rw-r--r-- | src/cff/cffload.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/cff/cffload.c b/src/cff/cffload.c index 91e74f32c..3beaeb1c8 100644 --- a/src/cff/cffload.c +++ b/src/cff/cffload.c @@ -2280,8 +2280,10 @@ goto Exit; } - /* font names must not be empty */ - if ( font->name_index.data_size < font->name_index.count ) + /* if we have an empty font name, */ + /* it must be the only font in the CFF */ + if ( font->name_index.count > 1 && + font->name_index.data_size < font->name_index.count ) { /* for pure CFFs, we still haven't checked enough bytes */ /* to be sure that it is a CFF at all */ |