[pango] Add a runtime version check for harfbuzz
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pango] Add a runtime version check for harfbuzz
- Date: Mon, 19 Aug 2019 12:25:31 +0000 (UTC)
commit fb72c7dd3e074f28e7cfa98388a87f1aaffc12ee
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Aug 19 14:23:55 2019 +0200
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.
pango/pangofc-fontmap.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]