summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-05-08 22:21:07 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-05-09 12:13:33 +0200
commitb0be0d419576c4ba2ad0f904592879a7736cbfaf (patch)
treef3f04a0c676bf2b9841ddefcd24fea1bb26f5fe9
parent7aeff452bfd308d122c319ed5135bd98e90590f8 (diff)
Blind attempt to fix UBSAN error in FreetypeFont
The only place that calls FreetypeFontInstance::SetFreetypeFont() is FreetypeFont::FreetypeFont() calling it with “this”: static_cast<FreetypeFontInstance*>(mpFontInstance)->SetFreetypeFont( this ); So I don’t think we need to manage that FreetypeFont pointer, as it it is guaranteed to be valid as long as this FreetypeFontInstance is valid. Too many font classes and it is really hard to reason what is doing what… Change-Id: Iee50d2ecc4084116c13a2d2464594d6cffdcfcfe Reviewed-on: https://gerrit.libreoffice.org/54008 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--vcl/unx/generic/glyphs/glyphcache.cxx7
1 files changed, 0 insertions, 7 deletions
diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/unx/generic/glyphs/glyphcache.cxx
index ac2eaf5498e3..cff473c9036c 100644
--- a/vcl/unx/generic/glyphs/glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/glyphcache.cxx
@@ -357,18 +357,11 @@ void FreetypeFontInstance::SetFreetypeFont(FreetypeFont* p)
{
if (p == mpFreetypeFont)
return;
- if (mpFreetypeFont)
- mpFreetypeFont->Release();
mpFreetypeFont = p;
- if (mpFreetypeFont)
- mpFreetypeFont->AddRef();
}
FreetypeFontInstance::~FreetypeFontInstance()
{
- // TODO: remove the FreetypeFont here instead of in the GlyphCache
- if (mpFreetypeFont)
- mpFreetypeFont->Release();
}
static hb_blob_t* getFontTable(hb_face_t* /*face*/, hb_tag_t nTableTag, void* pUserData)