[cff] Thinkos in bias handling. Only the final result is always positive. Bug introduced three commits earlier. * src/cff/cffgload.c, src/cff/cffgload.h: Apply.
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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
diff --git a/ChangeLog b/ChangeLog
index 976c165..d5436be 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
2015-02-20 Werner Lemberg <wl@gnu.org>
+ [cff] Thinkos in bias handling.
+
+ Only the final result is always positive.
+
+ Bug introduced three commits earlier.
+
+ * src/cff/cffgload.c, src/cff/cffgload.h: Apply.
+
+2015-02-20 Werner Lemberg <wl@gnu.org>
+
[cid] Fix signedness issues and emit some better error codes.
* src/cid/cidgload.c, src/cid/cidload.h, src/cid/cidobjs.c,
diff --git a/src/cff/cffgload.c b/src/cff/cffgload.c
index 0afa745..b20ad50 100644
--- a/src/cff/cffgload.c
+++ b/src/cff/cffgload.c
@@ -337,7 +337,7 @@
/* */
/* <Return> */
/* The bias value. */
- static FT_UInt
+ static FT_Int
cff_compute_bias( FT_Int in_charstring_type,
FT_UInt num_subrs )
{
@@ -2385,7 +2385,8 @@
case cff_op_callsubr:
{
- FT_UInt idx = ( (FT_UInt)args[0] >> 16 ) + decoder->locals_bias;
+ FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ decoder->locals_bias );
FT_TRACE4(( " callsubr(%d)\n", idx ));
@@ -2426,7 +2427,8 @@
case cff_op_callgsubr:
{
- FT_UInt idx = ( (FT_UInt)args[0] >> 16 ) + decoder->globals_bias;
+ FT_UInt idx = (FT_UInt)( ( args[0] >> 16 ) +
+ decoder->globals_bias );
FT_TRACE4(( " callgsubr(%d)\n", idx ));
diff --git a/src/cff/cffgload.h b/src/cff/cffgload.h
index 39c5f32..5c52d43 100644
--- a/src/cff/cffgload.h
+++ b/src/cff/cffgload.h
@@ -178,8 +178,8 @@ FT_BEGIN_HEADER
FT_UInt num_locals;
FT_UInt num_globals;
- FT_UInt locals_bias;
- FT_UInt globals_bias;
+ FT_Int locals_bias;
+ FT_Int globals_bias;
FT_Byte** locals;
FT_Byte** globals;