diff options
author | Ebrahim Byagowi <ebrahim@gnu.org> | 2018-06-18 19:59:33 +0430 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-06-18 19:59:33 +0430 |
commit | d0c2889dfc43da92c76d6eab5482b1298744dc9c (patch) | |
tree | bd6ebbc8554a8f4b1fbb57d1ebe400d0e1cd7d3a /util | |
parent | c53697d3f2a3fae8b68ec4c5146c7000a07e0963 (diff) |
Revert file blob sanitization and index checking (#1062)
As https://github.com/harfbuzz/harfbuzz/pull/1059#issuecomment-397912812 we
like to still work with blobs that harfbuzz itself can't handle directly that are failing sanitization
currently apparently.
Diffstat (limited to 'util')
-rw-r--r-- | util/options.cc | 12 | ||||
-rw-r--r-- | util/options.hh | 2 |
2 files changed, 3 insertions, 11 deletions
diff --git a/util/options.cc b/util/options.cc index 299466fe..682e40c4 100644 --- a/util/options.cc +++ b/util/options.cc @@ -670,16 +670,8 @@ font_options_t::get_font (void) const blob = hb_blob_create_from_file (font_file); } - if (hb_blob_get_length (blob) == 0) - fail (false, "No such file or directory, or is empty"); - - unsigned int face_count = hb_face_count (blob); - - if (face_count == 0) - fail (false, "Not a font file"); // most likely - - if (face_index > face_count) - fail (false, "The requested font index wasn't available in the file"); + if (blob == hb_blob_get_empty ()) + fail (false, "No such file or directory"); /* Create the face */ hb_face_t *face = hb_face_create (blob, face_index); diff --git a/util/options.hh b/util/options.hh index 5287395a..2160d5ec 100644 --- a/util/options.hh +++ b/util/options.hh @@ -485,7 +485,7 @@ struct font_options_t : option_group_t mutable double font_size_y; char *font_funcs; -private: + private: mutable hb_font_t *font; }; |