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

[var] Fix hb_ot_var_get_axis_infos's offset semantic #2221

Merged
merged 1 commit into from
Mar 5, 2020

Conversation

ebraminio
Copy link
Collaborator

The API was adding offset to input's infos buffer index also which is
unusual between our APIs and wrong.

start_offset = hb_min (start_offset, count);

count -= start_offset;
axes_array += start_offset;
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the part that was wrong, start_offset isn't intended to be added to axes_array index but just used just as a AxisRecord index offset.

g_assert (info.tag == HB_TAG ('w','g','h','t'));

hb_ot_var_get_axis_infos (face, 1, &c, &info);
g_assert (info.tag == HB_TAG ('w','d','t','h'));
Copy link
Collaborator Author

@ebraminio ebraminio Mar 3, 2020

Choose a reason for hiding this comment

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

This didn't work before this change. was hammering stack…

@ebraminio
Copy link
Collaborator Author

@khaledhosny @behdad What do you suggest? Do you know clients that were using offset of the API? This overflows buffer for clients who iterating axis in usual way of HarfBuzz API.

@ebraminio
Copy link
Collaborator Author

Pango fortunately doesn't use its offset, guess no client would use as it is broken anyway.

The API was adding offset to input's infos buffer index also which is
unusual between our APIs and wrong.
@ebraminio
Copy link
Collaborator Author

Any pointers?

@behdad
Copy link
Member

behdad commented Mar 5, 2020

Yeah I think is safe to fix.

No idea why I didn't just use sub_array to begin with... But yeah I put TODOs where I insert bugs apparently!

@ebraminio ebraminio merged commit 6924e29 into harfbuzz:master Mar 5, 2020
@ebraminio
Copy link
Collaborator Author

Thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants