209614c
From c26872ed59cba3af2f407b5eefc92fcec92aa52b Mon Sep 17 00:00:00 2001
209614c
From: Ben Wagner <bungeman@chromium.org>
209614c
Date: Thu, 26 May 2022 20:27:53 -0400
209614c
Subject: [svg] Clear correct flags for doc ownership
209614c
209614c
This issue was discovered with an SVG based font with some documents
209614c
compressed and other uncompressed. After loading the first compressed
209614c
document the ownership flag on the glyph slot was set to true but never
209614c
set to false. As a result after loading a compressed document a glyph
209614c
from an uncompressed document would load fine, but when this glyph slot
209614c
was cleared it would try to free its document resulting in a wild free.
209614c
209614c
* src/base/ftobjs.c (ft_glyphslot_clear): clear correct flags
209614c
209614c
Fixes: #1162
209614c
209614c
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
209614c
index eeda69c3e..f66273f3d 100644
209614c
--- a/src/base/ftobjs.c
209614c
+++ b/src/base/ftobjs.c
209614c
@@ -605,7 +605,7 @@
209614c
 
209614c
 
209614c
         FT_FREE( doc->svg_document );
209614c
-        slot->internal->load_flags &= ~FT_GLYPH_OWN_GZIP_SVG;
209614c
+        slot->internal->flags &= ~FT_GLYPH_OWN_GZIP_SVG;
209614c
       }
209614c
     }
209614c
 #endif