Repository navigation
Conversation
render() has been guarded with catch_unwind since 2.7.0-alpha.1, but the constructor parses the SVG and converts text to paths, which runs the text shaper. A panic there still aborted the Node.js process, for example on a <text> holding a lone U+1B44 (Balinese virama), which makes rustybuzz 0.7.0 read out of bounds. - Wrap Resvg::new_inner in catch_unwind for the constructor and for AsyncRenderer::compute, and report it as Error::ParsePanic. - Test both entry points with a test-only switch that makes new_inner panic, so the tests do not depend on a bug in resvg or rustybuzz. - Run cargo test in the lint workflow. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
@schneefux is attempting to deploy a commit to the yisibl's projects Team on Vercel. A member of the Team first needs to authorize it. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #396.
render()has been guarded withcatch_unwindsince 2.7.0-alpha.1, but the constructor andrenderAsync()are not. The constructor parses the SVG and shapes its text, so a panic there still aborts Node.js.Reproduction
On a machine with a font installed that supports Balinese (e.g. Noto Sans Balinese on Linux, or standard macOS):
node -e "new (require('@resvg/resvg-js').Resvg)('<svg xmlns=\"http://www.w3.org/2000/svg\"><text>᭄</text></svg>')"Cause
The panic is a bug in rustybuzz 0.7.0, the text shaper of resvg 0.34. rustybuzz 0.9.0 fixed it (harfbuzz/rustybuzz#65), available since resvg 0.36. This PR does not fix the bug, but it turns the panic into an error that can be caught.
Note: Commit and PR were co-authored with Claude Fable 5.2