Skip to content
Myr

render: don't crash (division-by-zero) when color alpha is 0.0

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 537148c · Browse files · 1 file+3 added−0 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−0 removed

  • other:+3 added−0 removed

1 file+3 added−0 removed

modified:render.c+3 added
63 unmodified lines
6465static pixman_color_t66rgba2pixman(struct rgba rgba)67{68 if (rgba.a == 0.)69 return (pixman_color_t){0, 0, 0, 0};7071 uint16_t r = rgba.r * 65535.0;72 uint16_t g = rgba.g * 65535.0;73 uint16_t b = rgba.b * 65535.0;74 uint16_t a = rgba.a * 65535.0;
236 unmodified lines