Skip to content
This repository has been archived by the owner on Nov 1, 2021. It is now read-only.

Commit

Permalink
Fix uint32 overflow in fill_empty_gamma_table on Icelake platform
Browse files Browse the repository at this point in the history
  • Loading branch information
filips committed Mar 15, 2020
1 parent 1282c3b commit 5ee52a3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion backend/drm/drm.c
Original file line number Diff line number Diff line change
Expand Up @@ -501,8 +501,9 @@ static bool drm_connector_commit(struct wlr_output *output) {

static void fill_empty_gamma_table(size_t size,
uint16_t *r, uint16_t *g, uint16_t *b) {
assert(0xFFFF < UINT64_MAX / (size - 1));
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;
}
}
Expand Down

0 comments on commit 5ee52a3

Please sign in to comment.