Disallow changing settings on immutable face

Ouch!
This commit is contained in:
Behdad Esfahbod 2014-07-22 16:26:27 -04:00
parent 0fc0a10228
commit 3f310dc0ca
3 changed files with 7 additions and 7 deletions

View File

@ -298,7 +298,7 @@ hb_face_get_user_data (hb_face_t *face,
void void
hb_face_make_immutable (hb_face_t *face) hb_face_make_immutable (hb_face_t *face)
{ {
if (hb_object_is_inert (face)) if (unlikely (hb_object_is_inert (face)))
return; return;
face->immutable = true; face->immutable = true;
@ -368,7 +368,7 @@ void
hb_face_set_index (hb_face_t *face, hb_face_set_index (hb_face_t *face,
unsigned int index) unsigned int index)
{ {
if (hb_object_is_inert (face)) if (face->immutable)
return; return;
face->index = index; face->index = index;
@ -403,7 +403,7 @@ void
hb_face_set_upem (hb_face_t *face, hb_face_set_upem (hb_face_t *face,
unsigned int upem) unsigned int upem)
{ {
if (hb_object_is_inert (face)) if (face->immutable)
return; return;
face->upem = upem; face->upem = upem;
@ -447,7 +447,7 @@ void
hb_face_set_glyph_count (hb_face_t *face, hb_face_set_glyph_count (hb_face_t *face,
unsigned int glyph_count) unsigned int glyph_count)
{ {
if (hb_object_is_inert (face)) if (face->immutable)
return; return;
face->num_glyphs = glyph_count; face->num_glyphs = glyph_count;

View File

@ -357,7 +357,7 @@ hb_font_funcs_get_user_data (hb_font_funcs_t *ffuncs,
void void
hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs) hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
{ {
if (hb_object_is_inert (ffuncs)) if (unlikely (hb_object_is_inert (ffuncs)))
return; return;
ffuncs->immutable = true; ffuncs->immutable = true;
@ -1034,7 +1034,7 @@ hb_font_get_user_data (hb_font_t *font,
void void
hb_font_make_immutable (hb_font_t *font) hb_font_make_immutable (hb_font_t *font)
{ {
if (hb_object_is_inert (font)) if (unlikely (hb_object_is_inert (font)))
return; return;
font->immutable = true; font->immutable = true;

View File

@ -310,7 +310,7 @@ hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
void void
hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs) hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
{ {
if (hb_object_is_inert (ufuncs)) if (unlikely (hb_object_is_inert (ufuncs)))
return; return;
ufuncs->immutable = true; ufuncs->immutable = true;