Skip to content
Myr

render: don't pass a negative radius to fill_rounded_rectangle()

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

If the border *size* is bigger than the border *radius*, we ended up passing a negative radius to fill_rounded_rectangle(). Since the radius parameter in fill_rounded_rectangle() is an uint16_t, we ended up passing a *very large* value, e.g. 65535. This resulted in an integer overflow when calculating the number of pixman rectangles to use, leading to a crash when calling pixman_image_fill_rectangles(). Closes #401

authored by Daniel Eklöf · committed by Daniel Eklöf · parent 3e6d682 · Browse files · 2 files+8 added−1 removed
This commit

State

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

Diff stats

2 files+8 added−1 removed

  • other:+8 added−1 removed

2 files+8 added−1 removed

modified:CHANGELOG.md+7 added
31 unmodified lines
32### Changed33### Deprecated34### Removed35### Fixed3637* Crash when the border size is larger than the border radius38 ([#401][401]).3940[401]: https://codeberg.org/dnkl/fuzzel/issues/401414243### Security44### Contributors4546
783 unmodified lines
modified:render.c+1 added-1 removed
203 unmodified lines
204 fill_rounded_rectangle(205 PIXMAN_OP_SRC, bg_img, &bg, brd_sz_scaled, brd_sz_scaled,206 w-(brd_sz_scaled*2),207 h-(brd_sz_scaled*2),208 brd_rad_scaled - brd_sz_scaled);208 max(brd_rad_scaled - brd_sz_scaled, 0));209210 if (msaa_scale != 1){211 pixman_f_transform_t ftrans;212 pixman_transform_t trans;
1206 unmodified lines