From 8b6bcc92c5907cfad9e20b1b7bfaef96e2d93ebf Mon Sep 17 00:00:00 2001 From: Alexei Podtelezhnikov Date: Sun, 12 Jun 2022 09:04:13 -0400 Subject: [PATCH] * src/sfnt/sfwoff2.c (woff2_open_font): Partial revert. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=47981. --- src/sfnt/sfwoff2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sfnt/sfwoff2.c b/src/sfnt/sfwoff2.c index fd9674deb..049a142a8 100644 --- a/src/sfnt/sfwoff2.c +++ b/src/sfnt/sfwoff2.c @@ -2004,7 +2004,8 @@ FT_TRACE4(( "Number of fonts in TTC: %d\n", woff2.num_fonts )); - if ( FT_QNEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) ) + /* pre-zero pointers within in case of failure */ + if ( FT_NEW_ARRAY( woff2.ttc_fonts, woff2.num_fonts ) ) goto Exit; for ( nn = 0; nn < woff2.num_fonts; nn++ )