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

Out-of-bounds path nodes shouldn't panic. #12

Open
nigeltao opened this issue Aug 28, 2016 · 0 comments
Open

Out-of-bounds path nodes shouldn't panic. #12

nigeltao opened this issue Aug 28, 2016 · 0 comments

Comments

@nigeltao
Copy link

For well formed TrueType glyph data, the bounding box should contain all of the nodes. However, malicious data might lead to out-of-bounds nodes, so more bounds checking is necessary for a production quality rasterizer.

Even with well formed data, I suspect (based on my Go port) that the Rust version will panic at a line like

self.a[linestart + (x0i + 1) as usize]

when the glyph being rendered has an on-curve point at the bottom right corner of the rasterization buffer. You should be able to see this with the capital-'I' glyph from a sans-serif font.

In my Go port, I tightened this up in google/font-go@568cda6

blofroth pushed a commit to blofroth/font-rs that referenced this issue Aug 7, 2018
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

1 participant