* 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
This commit is contained in:
Werner Lemberg 2017-03-31 09:35:58 +02:00
parent c8c6763988
commit 5a3490e054
2 changed files with 14 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2017-03-31 Werner Lemberg <wl@gnu.org>
* 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
2017-03-30 Werner Lemberg <wl@gnu.org>
* src/cff/cffparse.h (CFF2_DEFAULT_STACK): Set to 513 also.

View File

@ -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 */