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

Fixed assert "out of range region index found in item variation store… #266

Merged
merged 1 commit into from
Feb 8, 2018

Conversation

blueshade7
Copy link
Contributor

… subtable"

Fixed an assert "out of range region index found in item variation store subtable " in var_getIVSRegionIndices because a wrong region count was used to range-check region indexes.
The bug was exposed when reading Monotype AvenirNext-Variable.ttf

… subtable"

Fixed an assert "out of range region index found in item variation store subtable " in var_getIVSRegionIndices because a wrong region count was used to range-check region indexes.
The bug was exposed when reading Monotype AvenirNext-Variable.ttf
@readroberts
Copy link
Contributor

How did this cause a bug? It looks to me as if the regionCount is either the subtable region count, or the IVS region list count, and is used only to make sure that no region index exceeds this value. Also, I think it might be useful to make sure regionCount is set the same in all the call chains to var_getIVSRegionIndices.

@blueshade7
Copy link
Contributor Author

The value of variable regionCount is taken from the variation region list, while subtable->regionCount is the number of region indices referenced by a subtable, which may be less than regionCount. This field in itemVariationDataSubtable struct is better to be renamed to "regionIndexCount" to avoid confusion actually, the name used in OT spec for this data.

When a smaller value (subtable->regionCount) than actual (regionCount) is passed to var_getIVSRegionIndices, it may reject a valid region index as invalid.

@miguelsousa miguelsousa requested review from miguelsousa and removed request for miguelsousa February 7, 2018 23:04
Copy link
Contributor

@cjchapman cjchapman left a comment

Choose a reason for hiding this comment

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

I think this change is fine.

It would be good for 'This field in itemVariationDataSubtable struct ... to be renamed to "regionIndexCount" to avoid confusion...' as Ariza mentioned in his notes, but that can be done later.

@readroberts readroberts merged commit 312b012 into adobe-type-tools:master Feb 8, 2018
@readroberts
Copy link
Contributor

I will open a new issue for the variable name confusion.

@miguelsousa
Copy link
Member

Follow up issue #272

schriftgestalt pushed a commit to schriftgestalt/afdko that referenced this pull request May 18, 2019
… subtable" (adobe-type-tools#266)

Fixed an assert "out of range region index found in item variation store subtable " in var_getIVSRegionIndices because a wrong region count was used to range-check region indexes.
The bug was exposed when reading Monotype AvenirNext-Variable.ttf
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.

4 participants