Repository navigation
fix(rendering): avoid panics for non-ascii hex colours - #2903
Open
yashranaway wants to merge 2 commits into
Open
yashranaway wants to merge 2 commits into
yashranaway wants to merge 2 commits into
Conversation
Contributor
Author
|
@greptileai review |
Contributor
|
@yashranaway is attempting to deploy a commit to the Cap Software Inc 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.
the renderer reads hex colours for captions, overlays and backgrounds by slicing the string two bytes at a time. a colour that's six bytes long but not ascii, like a couple of cjk characters or an emoji after the #, passes the length check and then the slice lands inside a character and panics, which kills preview or export. the editor's own inputs only allow hex digits, so this comes from hand edited, corrupted or migrated project files.
now non ascii strings take the same white fallback as any other unparseable colour. tests cover upper and lower case hex, other unsupported formats and the multibyte cases.


Confidence Score: 5/5
The PR appears safe to merge.Summary
Adds an ASCII check to
parse_color_componentso malformed Unicode colours return white instead of causing a panic.Reviews (1) · Last reviewed commit: "fix(rendering): avoid panics for non-asc..." · Reviewed by Greptile