Commit 440aecf
committed
Fix math and shift overflow in function visual_color_to_uint32
Clang said:
> [..]/libvisual/lv_color.c:263:16: error: signed shift result (0x100000000) requires 34 bits to represent, but 'int' only has 32 bits [-Werror,-Wshift-overflow]
> colors = (256 << 24) |
> ~~~ ^ ~~
A closer look reveals that 255 (0xFF) is the maximum alpha value
and that 256 (0x100) should have been 255 in the first place.
Original report at https://sourceforge.net/p/libvisual/bugs/18/1 parent 92d7143 commit 440aecf
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
0 commit comments