mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
render/color: fix bounds check in lut_1d_get()
i == len is out-of-bounds.
Fixes: 74217a4d93 ("render/color: introduce COLOR_TRANSFORM_LUT_3X1D")
This commit is contained in:
parent
7cb3393e75
commit
60d72724cd
1 changed files with 1 additions and 1 deletions
|
|
@ -109,7 +109,7 @@ struct wlr_color_transform_lut_3x1d *color_transform_lut_3x1d_from_base(
|
||||||
}
|
}
|
||||||
|
|
||||||
static float lut_1d_get(const uint16_t *lut, size_t len, size_t i) {
|
static float lut_1d_get(const uint16_t *lut, size_t len, size_t i) {
|
||||||
if (i > len) {
|
if (i >= len) {
|
||||||
i = len - 1;
|
i = len - 1;
|
||||||
}
|
}
|
||||||
return (float) lut[i] / UINT16_MAX;
|
return (float) lut[i] / UINT16_MAX;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue