mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-26 14:45:58 +01:00
Fix uint32 overflow in fill_empty_gamma_table on Icelake platform
Closes: https://github.com/swaywm/sway/issues/4826
This commit is contained in:
parent
1282c3b12f
commit
5ee52a3ab9
1 changed files with 2 additions and 1 deletions
|
@ -501,8 +501,9 @@ static bool drm_connector_commit(struct wlr_output *output) {
|
||||||
|
|
||||||
static void fill_empty_gamma_table(size_t size,
|
static void fill_empty_gamma_table(size_t size,
|
||||||
uint16_t *r, uint16_t *g, uint16_t *b) {
|
uint16_t *r, uint16_t *g, uint16_t *b) {
|
||||||
|
assert(0xFFFF < UINT64_MAX / (size - 1));
|
||||||
for (uint32_t i = 0; i < size; ++i) {
|
for (uint32_t i = 0; i < size; ++i) {
|
||||||
uint16_t val = (uint32_t)0xffff * i / (size - 1);
|
uint16_t val = (uint64_t)0xffff * i / (size - 1);
|
||||||
r[i] = g[i] = b[i] = val;
|
r[i] = g[i] = b[i] = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue