* src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
This commit is contained in:
Werner Lemberg 2018-07-22 13:06:20 +02:00
parent 9be385c94d
commit b98133a4e9
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,11 @@
2018-07-22 Werner Lemberg <wl@gnu.org>
* src/pcf/pcfread.c (pcf_get_encodings): Check index of defaultChar.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=9527
2018-07-22 Werner Lemberg <wl@gnu.org>
* src/pcf/pcfread.c (pcf_load_font): Fix number of glyphs.

View File

@ -1059,6 +1059,14 @@ THE SOFTWARE.
else
defaultCharEncodingOffset = FT_PEEK_USHORT_LE( pos );
if ( defaultCharEncodingOffset >= face->nmetrics )
{
FT_TRACE0(( "pcf_get_encodings:"
" Invalid glyph index for default character,"
" setting to zero\n" ));
defaultCharEncodingOffset = 0;
}
if ( defaultCharEncodingOffset )
{
/* do the swapping */