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

woff2_decompress fails with “implausible compression ratio” #102

Closed
Lorp opened this issue Nov 21, 2017 · 2 comments
Closed

woff2_decompress fails with “implausible compression ratio” #102

Lorp opened this issue Nov 21, 2017 · 2 comments

Comments

@Lorp
Copy link

Lorp commented Nov 21, 2017

I get the following error when I attempt woff2_decompress on a woff2 font that I have just compressed using woff2_compress:

Implausible compression ratio 770.0

Admittedly the source TTF contains 65535 glyphs, almost all of which are duplicates. It is a test font, but I still expect to be able to decompress it.

@anthrotype
Copy link
Member

anthrotype commented Nov 21, 2017

interesting. Can fonttools decompress the font? Just curious...

@rsheeter
Copy link
Contributor

This is a safeguard against fonts crafted to achieve exactly this type of memory explosion in the browser.
For local testing you can set what's allowed @

const float kMaxPlausibleCompressionRatio = 100.0;

Browsers using the reference implementation will ofc reject such a font. I think this is working as intended unless evidence of realistic fonts with this kind of compression ratio emerge.

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

No branches or pull requests

3 participants