Commit c1b000da00c747cb46fd4c95ca83bee802d35487

Werner Lemberg 2017-03-05T20:23:35

[sfnt] Remove redundant code. * src/sfnt/sfobjs.c (sfnt_init_face): Remove second test for `num_instances', which will always succeed.

diff --git a/ChangeLog b/ChangeLog
index 4915436..3bbfe42 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-03-05  Werner Lemberg  <wl@gnu.org>
+
+	[sfnt] Remove redundant code.
+
+	* src/sfnt/sfobjs.c (sfnt_init_face): Remove second test for
+	`num_instances', which will always succeed.
+
 2017-03-04  Werner Lemberg  <wl@gnu.org>
 
 	[sfnt] Add `get_name_id' service.
diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c
index eb41704..4cc3e3f 100644
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -999,15 +999,6 @@
       if ( !face->goto_table( face, TTAG_CFF, stream, 0 ) )
         num_instances = 0;
 
-      /* we support at most 2^15 - 1 instances */
-      if ( num_instances >= ( 1U << 15 ) - 1 )
-      {
-        if ( face_instance_index >= 0 )
-          return FT_THROW( Invalid_Argument );
-        else
-          num_instances = 0;
-      }
-
       /* instance indices in `face_instance_index' start with index 1, */
       /* thus `>' and not `>='                                         */
       if ( instance_index > num_instances )