From bdf372b24c19516c7e608b3eb254fb3720b36b6c Mon Sep 17 00:00:00 2001 From: Ebrahim Byagowi Date: Sun, 8 Mar 2020 00:47:25 +0330 Subject: [PATCH] [subset/cbdt] Release the referenced cbdt table on error Just accidentally spotted it, when the table has less than 4 bytes --- src/hb-ot-color-cbdt-table.hh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/hb-ot-color-cbdt-table.hh b/src/hb-ot-color-cbdt-table.hh index de6be044c..c5617aa7e 100644 --- a/src/hb-ot-color-cbdt-table.hh +++ b/src/hb-ot-color-cbdt-table.hh @@ -955,7 +955,11 @@ CBLC::subset (hb_subset_context_t *c) const hb_blob_t* cbdt_blob = hb_sanitize_context_t ().reference_table (c->plan->source); unsigned int cbdt_length; CBDT* cbdt = (CBDT *) hb_blob_get_data (cbdt_blob, &cbdt_length); - if (unlikely (cbdt_length < CBDT::min_size)) return_trace (false); + if (unlikely (cbdt_length < CBDT::min_size)) + { + hb_blob_destroy (cbdt_blob); + return_trace (false); + } _copy_data_to_cbdt (&cbdt_prime, cbdt, CBDT::min_size); for (const BitmapSizeTable& table : + sizeTables.iter ())