diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-08-19 14:23:55 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-08-19 14:23:55 +0200 |
commit | fb72c7dd3e074f28e7cfa98388a87f1aaffc12ee (patch) | |
tree | 71af20173653c284c828c86e6abc6083992b0726 /pango | |
parent | 5e807b70f484893d6e3f05e266e3ab3e1e65d245 (diff) | |
download | pango-fb72c7dd3e074f28e7cfa98388a87f1aaffc12ee.tar.gz |
Add a runtime version check for harfbuzz
Electron apps seem to include a static copy of a
too old version of harfbuzz. Error out with a clear
message in this broken situation, instead of
segfaulting later.
Diffstat (limited to 'pango')
-rw-r--r-- | pango/pangofc-fontmap.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c index 2bda526e..c7193941 100644 --- a/pango/pangofc-fontmap.c +++ b/pango/pangofc-fontmap.c @@ -2752,11 +2752,14 @@ pango_fc_font_map_get_hb_face (PangoFcFontMap *fcfontmap, PangoFcFontFaceData *data; data = pango_fc_font_map_get_font_face_data (fcfontmap, fcfont->font_pattern); - + if (!data->hb_face) { hb_blob_t *blob; + if (!hb_version_atleast (2, 0, 0)) + g_error ("Harfbuzz version too old (%s)\n", hb_version_string ()); + blob = hb_blob_create_from_file (data->filename); data->hb_face = hb_face_create (blob, data->id); hb_blob_destroy (blob); |