Skip to content
Myr

render: fix uint16_t overflow

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 5d9d67d · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • other:+3 added−3 removed

1 file+3 added−3 removed

modified:render.c+3 added-3 removed
31 unmodified lines
32 uint16_t b = rgba.b * 65535.0;33 uint16_t a = rgba.a * 65535.0;3435 return (pixman_color_t){36 .red = r * a / 0xffff,37 .green = g * a / 0xffff,38 .blue = b * a / 0xffff,36 .red = (uint32_t)r * a / 0xffff,37 .green = (uint32_t)g * a / 0xffff,38 .blue = (uint32_t)b * a / 0xffff,39 .alpha = a,40 };41}42
452 unmodified lines