From a5fa843c746e20aaca48ece6cff057deb8d916ca Mon Sep 17 00:00:00 2001 From: Michiharu Ariza Date: Wed, 5 Dec 2018 11:18:16 -0800 Subject: [PATCH] fixed a bug with fractional part in a negative value --- src/hb-cff-interp-dict-common.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-cff-interp-dict-common.hh b/src/hb-cff-interp-dict-common.hh index 005e15e60..63ca685ec 100644 --- a/src/hb-cff-interp-dict-common.hh +++ b/src/hb-cff-interp-dict-common.hh @@ -146,7 +146,11 @@ struct DictOpSet : OpSet case END: value = (double)(neg? -int_part: int_part); if (frac_count > 0) - value += (frac_part / pow (10.0, (double)frac_count)); + { + double frac = (frac_part / pow (10.0, (double)frac_count)); + if (neg) frac = -frac; + value += frac; + } if (unlikely (exp_overflow)) { if (value == 0.0)