Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1069)

Unified Diff: third_party/harfbuzz-ng/src/hb-shape-plan.cc

Issue 203543007: Merge 257509 "Fix unsafe shape_plan->face dependency" (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1847/src/
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/harfbuzz-ng/src/hb-shape-plan.cc
===================================================================
--- third_party/harfbuzz-ng/src/hb-shape-plan.cc (revision 258046)
+++ third_party/harfbuzz-ng/src/hb-shape-plan.cc (working copy)
@@ -46,7 +46,7 @@
#define HB_SHAPER_PLAN(shaper) \
HB_STMT_START { \
- if (hb_##shaper##_shaper_face_data_ensure (shape_plan->face)) { \
+ if (hb_##shaper##_shaper_face_data_ensure (shape_plan->face_unsafe)) { \
HB_SHAPER_DATA (shaper, shape_plan) = \
HB_SHAPER_DATA_CREATE_FUNC (shaper, shape_plan) (shape_plan, user_features, num_user_features); \
shape_plan->shaper_func = _hb_##shaper##_shape; \
@@ -117,7 +117,7 @@
hb_face_make_immutable (face);
shape_plan->default_shaper_list = shaper_list == NULL;
- shape_plan->face = hb_face_reference (face);
+ shape_plan->face_unsafe = face;
shape_plan->props = *props;
hb_shape_plan_plan (shape_plan, user_features, num_user_features, shaper_list);
@@ -190,8 +190,6 @@
#include "hb-shaper-list.hh"
#undef HB_SHAPER_IMPLEMENT
- hb_face_destroy (shape_plan->face);
-
free (shape_plan);
}
@@ -264,7 +262,7 @@
hb_object_is_inert (buffer)))
return false;
- assert (shape_plan->face == font->face);
+ assert (shape_plan->face_unsafe == font->face);
assert (hb_segment_properties_equal (&shape_plan->props, &buffer->props));
#define HB_SHAPER_EXECUTE(shaper) \
@@ -395,9 +393,6 @@
goto retry;
}
- /* Release our reference on face. */
- hb_face_destroy (face);
-
return hb_shape_plan_reference (shape_plan);
}
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-ot-shape-private.hh ('k') | third_party/harfbuzz-ng/src/hb-shape-plan-private.hh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698