[cff] Catch `blend' op in non-variant fonts.

Reported as

  https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=334

* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdBLEND>: Don't
allow `blend' op for non-variant fonts.
This commit is contained in:
Werner Lemberg 2016-12-28 21:22:45 +01:00
parent c4cd34a9e0
commit c4a1ef3c94
2 changed files with 18 additions and 0 deletions

View File

@ -1,3 +1,14 @@
2016-12-28 Werner Lemberg <wl@gnu.org>
[cff] Catch `blend' op in non-variant fonts.
Reported as
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=334
* src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdBLEND>: Don't
allow `blend' op for non-variant fonts.
2016-12-28 Werner Lemberg <wl@gnu.org>
[cff] Better check of number of blends.

View File

@ -678,6 +678,13 @@
if ( !font->isCFF2 )
break; /* clear stack & ignore */
/* do we have a `blend' op in a non-variant font? */
if ( !font->blend.font )
{
lastError = FT_THROW( Invalid_Glyph_Format );
goto exit;
}
/* check cached blend vector */
if ( cff_blend_check_vector( &font->blend,
font->vsindex,