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

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

Issue 1408003004: Roll harfbuzz-ng to 1.0.5 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: Created 5 years, 2 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
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape.cc ('k') | third_party/harfbuzz-ng/src/hb-shaper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/harfbuzz-ng/src/hb-shape-plan.cc
diff --git a/third_party/harfbuzz-ng/src/hb-shape-plan.cc b/third_party/harfbuzz-ng/src/hb-shape-plan.cc
index d2f293d69dedc5a3a34239b0166e2fb15bd57345..56e2ea5c19254c1f94e696efba5b01151446ec66 100644
--- a/third_party/harfbuzz-ng/src/hb-shape-plan.cc
+++ b/third_party/harfbuzz-ng/src/hb-shape-plan.cc
@@ -128,7 +128,7 @@ hb_shape_plan_create (hb_face_t *face,
face = hb_face_get_empty ();
if (unlikely (!props))
return hb_shape_plan_get_empty ();
- if (num_user_features && !(features = (hb_feature_t *) malloc (num_user_features * sizeof (hb_feature_t))))
+ if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t))))
return hb_shape_plan_get_empty ();
if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) {
free (features);
@@ -293,8 +293,13 @@ hb_shape_plan_execute (hb_shape_plan_t *shape_plan,
num_features,
shape_plan->shaper_func);
- if (unlikely (hb_object_is_inert (shape_plan) ||
- hb_object_is_inert (buffer)))
+ if (unlikely (!buffer->len))
+ return true;
+
+ assert (!hb_object_is_inert (buffer));
+ assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
+
+ if (unlikely (hb_object_is_inert (shape_plan)))
return false;
assert (shape_plan->face_unsafe == font->face);
« no previous file with comments | « third_party/harfbuzz-ng/src/hb-shape.cc ('k') | third_party/harfbuzz-ng/src/hb-shaper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698