summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh b/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
index a72100e1ab..332ece31cd 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-cff2-interp-cs.hh
@@ -52,7 +52,7 @@ struct blend_arg_t : number_t
void set_real (double v) { reset_blends (); number_t::set_real (v); }
void set_blends (unsigned int numValues_, unsigned int valueIndex_,
- unsigned int numBlends, hb_array_t<const blend_arg_t> blends_)
+ unsigned int numBlends, hb_array_t<const blend_arg_t> blends_)
{
numValues = numValues_;
valueIndex = valueIndex_;
@@ -80,7 +80,7 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<blend_arg_t, CFF2Subrs>
{
template <typename ACC>
void init (const byte_str_t &str, ACC &acc, unsigned int fd,
- const int *coords_=nullptr, unsigned int num_coords_=0)
+ const int *coords_=nullptr, unsigned int num_coords_=0)
{
SUPER::init (str, acc.globalSubrs, acc.privateDicts[fd].localSubrs);
@@ -90,7 +90,7 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<blend_arg_t, CFF2Subrs>
seen_blend = false;
seen_vsindex_ = false;
scalars.init ();
- do_blend = (coords != nullptr) && num_coords && (varStore != &Null(CFF2VariationStore));
+ do_blend = num_coords && coords && varStore->size;
set_ivs (acc.privateDicts[fd].ivs);
}
@@ -133,10 +133,11 @@ struct cff2_cs_interp_env_t : cs_interp_env_t<blend_arg_t, CFF2Subrs>
region_count = varStore->varStore.get_region_index_count (get_ivs ());
if (do_blend)
{
- scalars.resize (region_count);
- varStore->varStore.get_scalars (get_ivs (),
- (int *)coords, num_coords,
- &scalars[0], region_count);
+ if (unlikely (!scalars.resize (region_count)))
+ set_error ();
+ else
+ varStore->varStore.get_scalars (get_ivs (), coords, num_coords,
+ &scalars[0], region_count);
}
seen_blend = true;
}