[cff] Check for scalars array resize result

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=24504
This commit is contained in:
Ebrahim Byagowi 2020-07-31 08:58:53 +04:30
parent 040ed094ef
commit efd716de3f
2 changed files with 5 additions and 3 deletions

View File

@ -133,9 +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 ()); region_count = varStore->varStore.get_region_index_count (get_ivs ());
if (do_blend) if (do_blend)
{ {
scalars.resize (region_count); if (unlikely (!scalars.resize (region_count)))
varStore->varStore.get_scalars (get_ivs (), coords, num_coords, set_error ();
&scalars[0], region_count); else
varStore->varStore.get_scalars (get_ivs (), coords, num_coords,
&scalars[0], region_count);
} }
seen_blend = true; seen_blend = true;
} }