Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[subset] Drop glyph names from post when subsetting. #868

Merged
merged 3 commits into from
Mar 8, 2018

Conversation

garretrieger
Copy link
Collaborator

No description provided.

@garretrieger garretrieger requested a review from behdad March 7, 2018 19:39
hb_blob_t *post_blob = OT::Sanitizer<post>().sanitize (hb_face_reference_table (plan->source, HB_OT_TAG_post));
post *post_table = (post *) hb_blob_get_data (post_blob, nullptr);

post *post_prime = (post *) malloc (post::static_size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please allocate fixed-size objects using calloc(..., 1).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Reworked to use create sub blob.

return false;
}

memcpy (post_prime, post_table, post::static_size);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually does out-of-memory access if post_table is too short. Let me think what I suggest to use instead.

An idiom instead of malloc+memcpy is to create_sub_blob().

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed. Reworked to use create sub blob.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 64.712% when pulling 869ccac on googlefonts:post into 1ab5148 on harfbuzz:master.

@garretrieger garretrieger merged commit 2ebf4c6 into harfbuzz:master Mar 8, 2018
@garretrieger garretrieger deleted the post branch March 8, 2018 21:42
@khaledhosny khaledhosny added the subset hb-subset related bugs label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subset hb-subset related bugs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants