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

Fix calculation of overlap_simple_bit_stream_size #8

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jermy
Copy link

@jermy jermy commented Sep 9, 2024

This fixes the "Stream truncated" error seen with a number of woff2 fonts. Currently the calculation of overlap_simple_bit_stream_size uses the same function as for bitmap_stream_length but in the specification the latter should be rounded up to the next 32bit boundary, and the former should be only to the next byte boundary.

This simplifies/removes the bit_stream_byte_length function and uses the same inline calculation for this as the the woff2 reference decoder.

I know there's not much activity in this repository, but leaving this here if anybody else hits this issue.

This fixes the "Stream truncated" error seen with a number of woff2
fonts. Currently the calculation of overlap_simple_bit_stream_size uses
the same function as for bitmap_stream_length but in the specification
the latter should be rounded up to the next 32bit boundary, and the
former should be only to the next byte boundary.

This simplifies/removes the bit_stream_byte_length function and uses the
same inline calculation for this as the the woff2 reference decoder.
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.

1 participant