mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 12:55:58 +01:00
drm_format_set: fix realloc size
This commit is contained in:
parent
a3489f2c64
commit
7d9938c957
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue