[truetype] Prevent crash in `TT_Set_Named_Instance' (#56813).

* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error
handling.
GSoC-2020-greg
Werner Lemberg 5 years ago
parent ed7e8194e0
commit 594156586b
  1. 7
      ChangeLog
  2. 5
      src/truetype/ttgxvar.c

@ -1,3 +1,10 @@
2019-08-27 Werner Lemberg <wl@gnu.org>
[truetype] Prevent crash in `TT_Set_Named_Instance' (#56813).
* src/truetype/ttgxvar.c (TT_Set_Named_Instance): Fix error
handling.
2019-08-27 Werner Lemberg <wl@gnu.org>
[woff2] Fix compiler warnings.

@ -3037,7 +3037,7 @@
TT_Set_Named_Instance( TT_Face face,
FT_UInt instance_index )
{
FT_Error error = FT_ERR( Invalid_Argument );
FT_Error error;
GX_Blend blend;
FT_MM_Var* mmvar;
@ -3057,7 +3057,10 @@
/* `instance_index' starts with value 1, thus `>' */
if ( instance_index > num_instances )
{
error = FT_ERR( Invalid_Argument );
goto Exit;
}
if ( instance_index > 0 )
{

Loading…
Cancel
Save