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

fix(color) Bad cast in lv_color_mix() caused UB with 16bpp or less #2509

Merged
merged 1 commit into from Aug 30, 2021
Merged

fix(color) Bad cast in lv_color_mix() caused UB with 16bpp or less #2509

merged 1 commit into from Aug 30, 2021

Conversation

kevinpt
Copy link
Contributor

@kevinpt kevinpt commented Aug 28, 2021

Left shift overflows when lv_color_t is 16 bits or less because of cast outside parens.

Note that this showed up in a UBSan warning. Other devs should consider enabling it on platforms that support it.

@kisvegabor
Copy link
Member

Thanks!
I always build with -fsanitize=undefined on gcc 7.5.0 but haven't get warnings yet. Maybe I should update it :)

@kisvegabor kisvegabor merged commit 4d74194 into lvgl:master Aug 30, 2021
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.

None yet

3 participants