render/drm_format_set: fix corruption in wlr_drm_format_set_remove()

A single byte was moved instead of a full uint64_t. This results
in corrupted lists containing bogus modifiers.
This commit is contained in:
Simon Ser 2024-11-28 20:00:36 +01:00 committed by Kenny Levinsen
parent e21899037a
commit 2424b1ecdd

View file

@ -95,7 +95,7 @@ bool wlr_drm_format_set_remove(struct wlr_drm_format_set *set, uint32_t format,
for (size_t idx = 0; idx < fmt->len; idx++) {
if (fmt->modifiers[idx] == modifier) {
memmove(&fmt->modifiers[idx], &fmt->modifiers[idx+1], fmt->len - idx - 1);
memmove(&fmt->modifiers[idx], &fmt->modifiers[idx+1], (fmt->len - idx - 1) * sizeof(fmt->modifiers[0]));
fmt->len--;
return true;
}