[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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
diff --git a/ChangeLog b/ChangeLog
index c58d6bf..f2b8365 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2011-07-10 Алексей Подтележников <apodtele@gmail.com>
+
+ [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 <wl@gnu.org>
[psaux] Add better argument check for `callothersubr'.
diff --git a/src/psaux/t1decode.c b/src/psaux/t1decode.c
index a60ec38..55c81e3 100644
--- 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:"