aboutsummaryrefslogtreecommitdiff
path: root/render/drm_format_set.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2020-12-08 23:35:05 +0100
committerSimon Ser <contact@emersion.fr>2020-12-08 23:35:05 +0100
commit8a6930c138807cb04e2ef738cebe907877eaf292 (patch)
treefd3a5b5e02de7ba556fab46200b79220c56ac14d /render/drm_format_set.c
parent06ab41a160ddac970657254ded4258039fe9d317 (diff)
render/drm_format_set: assert len <= cap when duplicating
Diffstat (limited to 'render/drm_format_set.c')
-rw-r--r--render/drm_format_set.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/render/drm_format_set.c b/render/drm_format_set.c
index b3e8648e..a4c31494 100644
--- a/render/drm_format_set.c
+++ b/render/drm_format_set.c
@@ -128,6 +128,7 @@ bool wlr_drm_format_set_add(struct wlr_drm_format_set *set, uint32_t format,
}
struct wlr_drm_format *wlr_drm_format_dup(const struct wlr_drm_format *format) {
+ assert(format->len <= format->cap);
size_t format_size = sizeof(struct wlr_drm_format) +
format->cap * sizeof(format->modifiers[0]);
struct wlr_drm_format *duped_format = malloc(format_size);