未验证 提交 cf4b7db6 编写于 作者: E Ebrahim Byagowi 提交者: GitHub

Merge pull request #1448 from harfbuzz/cff-leak

[CFF] fix leak: oss-fuzz 11662
......@@ -1092,6 +1092,7 @@ struct cff1
CFF1FontDict_Interpreter font_interp;
font_interp.env.init (fontDictStr);
font = fontDicts.push ();
if (unlikely (font == &Crap(CFF1FontDictValues))) { fini (); return; }
font->init ();
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
PRIVDICTVAL *priv = &privateDicts[i];
......@@ -1131,7 +1132,7 @@ struct cff1
{
sc.end_processing ();
topDict.fini ();
fontDicts.fini ();
fontDicts.fini_deep ();
privateDicts.fini_deep ();
hb_blob_destroy (blob);
blob = nullptr;
......
......@@ -486,6 +486,7 @@ struct cff2
CFF2FontDict_Interpreter font_interp;
font_interp.env.init (fontDictStr);
font = fontDicts.push ();
if (unlikely (font == &Crap(CFF2FontDictValues))) { fini (); return; }
font->init ();
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
......@@ -506,7 +507,7 @@ struct cff2
inline void fini (void)
{
sc.end_processing ();
fontDicts.fini ();
fontDicts.fini_deep ();
privateDicts.fini_deep ();
hb_blob_destroy (blob);
blob = nullptr;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册