From 0ca7ad4352eff357cbb5cc1dfe62aa15b440de84 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 20 May 2019 11:39:07 -0400 Subject: [PATCH] [cff] Fix unlikely invocations --- src/hb-ot-cff-common.hh | 8 ++++---- src/hb-ot-cff1-table.hh | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/hb-ot-cff-common.hh b/src/hb-ot-cff-common.hh index ef72feddd..ddec517a1 100644 --- a/src/hb-ot-cff-common.hh +++ b/src/hb-ot-cff-common.hh @@ -132,7 +132,7 @@ struct CFFIndex if (unlikely (!c->extend_min (*this))) return_trace (false); this->count = byteArray.length; this->offSize = offSize_; - if (!unlikely (c->allocate_size (offSize_ * (byteArray.length + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (byteArray.length + 1)))) return_trace (false); /* serialize indices */ @@ -277,7 +277,7 @@ struct CFFIndexOf : CFFIndex if (unlikely (!c->extend_min (*this))) return_trace (false); this->count = dataArrayLen; this->offSize = offSize_; - if (!unlikely (c->allocate_size (offSize_ * (dataArrayLen + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (dataArrayLen + 1)))) return_trace (false); /* serialize indices */ @@ -479,7 +479,7 @@ struct FDArray : CFFIndexOf if (unlikely (!c->extend_min (*this))) return_trace (false); this->count = fontDicts.length; this->offSize = offSize_; - if (!unlikely (c->allocate_size (offSize_ * (fontDicts.length + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (fontDicts.length + 1)))) return_trace (false); /* serialize font dict offsets */ @@ -516,7 +516,7 @@ struct FDArray : CFFIndexOf if (unlikely (!c->extend_min (*this))) return_trace (false); this->count = fdCount; this->offSize = offSize_; - if (!unlikely (c->allocate_size (offSize_ * (fdCount + 1)))) + if (unlikely (!c->allocate_size (offSize_ * (fdCount + 1)))) return_trace (false); /* serialize font dict offsets */ diff --git a/src/hb-ot-cff1-table.hh b/src/hb-ot-cff1-table.hh index 8aac5486c..3a887d3d0 100644 --- a/src/hb-ot-cff1-table.hh +++ b/src/hb-ot-cff1-table.hh @@ -576,7 +576,7 @@ struct CFF1StringIndex : CFF1Index TRACE_SERIALIZE (this); if (unlikely ((strings.count == 0) || (sidmap.get_count () == 0))) { - if (!unlikely (c->extend_min (this->count))) + if (unlikely (!c->extend_min (this->count))) return_trace (false); count = 0; return_trace (true);