Skip to content

fix(vxfw): out of bounds panic on ScrollBars#343

Merged
rockorager merged 1 commit into
rockorager:mainfrom
undo-k:main
May 25, 2026
Merged

fix(vxfw): out of bounds panic on ScrollBars#343
rockorager merged 1 commit into
rockorager:mainfrom
undo-k:main

Conversation

@undo-k
Copy link
Copy Markdown
Contributor

@undo-k undo-k commented May 25, 2026

Dragging a scrollbar with enough force and determination can cause new_thumb_top and new_thumb_col_start to be negative (both are i16), which causes an out of bounds panic when assigning to a u32 on L194 and L254.

Copy link
Copy Markdown
Owner

@rockorager rockorager left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. The mouse drag coordinates are signed, so using <= 0 correctly handles dragging past the top/left before converting through float to u32 scroll positions. I also ran locally on the PR branch.

@undo-k
Copy link
Copy Markdown
Contributor Author

undo-k commented May 25, 2026

@rockorager dude that was crazy fast. Thanks for the review

@rockorager rockorager merged commit a367b89 into rockorager:main May 25, 2026
4 checks passed
@rockorager
Copy link
Copy Markdown
Owner

AI ;)

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