shithub: freetype+ttf2subf

Download patch

ref: dc33b4a1555c184b83a402dfa1856b213e6b4fbd
parent: c46b1e2476cc1804c0dd25d463be3c99d58befd7
author: Алексей Подтележников <[email protected]>
date: Sun Jul 10 03:08:51 EDT 2011

[psaux] Optimize previous commit.

* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
<op_callothersubr>: Move error check down to avoid testing twice for
good cases.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-10  Алексей Подтележников  <[email protected]>
+
+	[psaux] Optimize previous commit.
+
+	* src/psaux/t1decode.c (t1_decoder_parse_charstrings)
+	<op_callothersubr>: Move error check down to avoid testing twice for
+	good cases.
+
 2011-07-08  Werner Lemberg  <[email protected]>
 
 	[psaux] Add better argument check for `callothersubr'.
--- a/src/psaux/t1decode.c
+++ b/src/psaux/t1decode.c
@@ -686,9 +686,6 @@
         subr_no = (FT_Int)( top[1] >> 16 );
         arg_cnt = (FT_Int)( top[0] >> 16 );
 
-        if ( arg_cnt < 0 || subr_no < 0 )
-          goto Unexpected_OtherSubr;
-
         /***********************************************************/
         /*                                                         */
         /* remove all operands to callothersubr from the stack     */
@@ -1011,11 +1008,14 @@
           break;
 
         default:
-          FT_ERROR(( "t1_decoder_parse_charstrings:"
-                     " unknown othersubr [%d %d], wish me luck\n",
-                     arg_cnt, subr_no ));
-          unknown_othersubr_result_cnt = arg_cnt;
-          break;
+          if ( arg_cnt >= 0 && subr_no > 0 )
+          {
+            FT_ERROR(( "t1_decoder_parse_charstrings:"
+                       " unknown othersubr [%d %d], wish me luck\n",
+                       arg_cnt, subr_no ));
+            unknown_othersubr_result_cnt = arg_cnt;
+            break;
+          }
 
         Unexpected_OtherSubr:
           FT_ERROR(( "t1_decoder_parse_charstrings:"