aboutsummaryrefslogtreecommitdiff
path: root/render/drm_format_set.c
diff options
context:
space:
mode:
authorBrett Ernst <brett.ernst@icongroup.com>2023-03-16 18:13:11 -0700
committerBrett Ernst <brett.ernst@icongroup.com>2023-03-16 18:13:11 -0700
commit7d9938c957db32725b7d0b7f98d366676c0fa307 (patch)
tree38dc44b0321d01101c3f4c656f65020725df8e81 /render/drm_format_set.c
parenta3489f2c64d391240bfd190e1f4829cad618bac0 (diff)
drm_format_set: fix realloc size
Diffstat (limited to 'render/drm_format_set.c')
-rw-r--r--render/drm_format_set.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/render/drm_format_set.c b/render/drm_format_set.c
index 629327c0..b192c56c 100644
--- a/render/drm_format_set.c
+++ b/render/drm_format_set.c
@@ -67,7 +67,7 @@ bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
size_t new = set->capacity ? set->capacity * 2 : 4;
struct wlr_drm_format **tmp = realloc(set->formats,
- sizeof(*fmt) + sizeof(fmt->modifiers[0]) * new);
+ sizeof(set->formats[0]) * new);
if (!tmp) {
wlr_log_errno(WLR_ERROR, "Allocation failed");
free(fmt);