Skip to content

fix(rendering): avoid panics for non-ascii hex colours - #2903

Merged
richiemcilroy merged 3 commits into
CapSoftware:mainfrom
yashranaway:fix/unicode-overlay-colors
Oct 23, 2026
Merged

richiemcilroy merged 3 commits into
CapSoftware:mainfrom
yashranaway:fix/unicode-overlay-colors

Conversation

@yashranaway

@yashranaway yashranaway commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

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.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

Adds an ASCII check to parse_color_component so malformed Unicode colours return white instead of causing a panic.

  • Rendering keeps going when a color contains non-ASCII text.

Reviews (1) · Last reviewed commit: "fix(rendering): avoid panics for non-asc..." · Reviewed by Greptile

@yashranaway

Copy link
Copy Markdown
Contributor Author

@greptileai review

@vercel

vercel Bot commented Oct 22, 2026

Copy link
Copy Markdown
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.

@richiemcilroy
richiemcilroy merged commit 6a141ae into CapSoftware:main Oct 23, 2026
46 of 48 checks passed
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.

2 participants