[ENOMEM] fix access to unitialized memory.

If the serialize() call fails to write the object then we can't safely read varstore_prime fields. Fixes https://oss-fuzz.com/testcase-detail/5137462782066688.
pull/1695/head
Garret Rieger 4 years ago
parent 45de128930
commit 9825e3dd2e
  1. 5
      src/hb-ot-layout-common.hh
  2. BIN
      test/fuzzing/fonts/clusterfuzz-testcase-minimized-hb-subset-fuzzer-5137462782066688

@ -2537,7 +2537,10 @@ struct VariationStore
for (unsigned i = 0; i < inner_maps.length; i++)
inner_maps[i].fini ();
return_trace (bool (varstore_prime->dataSets));
return_trace (
!c->serializer->in_error()
&& varstore_prime->dataSets);
}
unsigned int get_region_index_count (unsigned int ivs) const

Loading…
Cancel
Save