Merge pull request #1448 from harfbuzz/cff-leak
[CFF] fix leak: oss-fuzz 11662
This commit is contained in:
commit
cf4b7db6b1
|
@ -1092,6 +1092,7 @@ struct cff1
|
||||||
CFF1FontDict_Interpreter font_interp;
|
CFF1FontDict_Interpreter font_interp;
|
||||||
font_interp.env.init (fontDictStr);
|
font_interp.env.init (fontDictStr);
|
||||||
font = fontDicts.push ();
|
font = fontDicts.push ();
|
||||||
|
if (unlikely (font == &Crap(CFF1FontDictValues))) { fini (); return; }
|
||||||
font->init ();
|
font->init ();
|
||||||
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
|
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
|
||||||
PRIVDICTVAL *priv = &privateDicts[i];
|
PRIVDICTVAL *priv = &privateDicts[i];
|
||||||
|
@ -1131,7 +1132,7 @@ struct cff1
|
||||||
{
|
{
|
||||||
sc.end_processing ();
|
sc.end_processing ();
|
||||||
topDict.fini ();
|
topDict.fini ();
|
||||||
fontDicts.fini ();
|
fontDicts.fini_deep ();
|
||||||
privateDicts.fini_deep ();
|
privateDicts.fini_deep ();
|
||||||
hb_blob_destroy (blob);
|
hb_blob_destroy (blob);
|
||||||
blob = nullptr;
|
blob = nullptr;
|
||||||
|
|
|
@ -486,6 +486,7 @@ struct cff2
|
||||||
CFF2FontDict_Interpreter font_interp;
|
CFF2FontDict_Interpreter font_interp;
|
||||||
font_interp.env.init (fontDictStr);
|
font_interp.env.init (fontDictStr);
|
||||||
font = fontDicts.push ();
|
font = fontDicts.push ();
|
||||||
|
if (unlikely (font == &Crap(CFF2FontDictValues))) { fini (); return; }
|
||||||
font->init ();
|
font->init ();
|
||||||
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
|
if (unlikely (!font_interp.interpret (*font))) { fini (); return; }
|
||||||
|
|
||||||
|
@ -506,7 +507,7 @@ struct cff2
|
||||||
inline void fini (void)
|
inline void fini (void)
|
||||||
{
|
{
|
||||||
sc.end_processing ();
|
sc.end_processing ();
|
||||||
fontDicts.fini ();
|
fontDicts.fini_deep ();
|
||||||
privateDicts.fini_deep ();
|
privateDicts.fini_deep ();
|
||||||
hb_blob_destroy (blob);
|
hb_blob_destroy (blob);
|
||||||
blob = nullptr;
|
blob = nullptr;
|
||||||
|
|
Binary file not shown.
Loading…
Reference in New Issue