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

[varLib] Possible bug in varStore.py? #2073

Closed
justvanrossum opened this issue Oct 2, 2020 · 2 comments · Fixed by #2083
Closed

[varLib] Possible bug in varStore.py? #2073

justvanrossum opened this issue Oct 2, 2020 · 2 comments · Fixed by #2083

Comments

@justvanrossum
Copy link
Collaborator

I am trying to learn how VarStores work, and am running into a bit of source code that looks off, even though I'm not sure I fully understand what's going on there.

Compare this fragment:

if len(self._data.Item) == 0xFFF:
# This is full. Need new one.
varDataIdx = None

With this:

inner = len(self._data.Item)
if inner == 0xFFFF:
# Full array. Start new one.
self._add_VarData()
return self.storeDeltas(deltas)

Shouldn't the former also test for 0xFFFF instead of 0xFFF?

@anthrotype
Copy link
Member

yeah, looks like a typo to me

@anthrotype
Copy link
Member

ItemVariationData.ItemCount is a uint16 so there can be max 0xFFFF items (deltaset rows) per VarData subtable

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 a pull request may close this issue.

2 participants