mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
drm_format_set_union: Require initialized dst and remove assert
This commit is contained in:
parent
d7917d2076
commit
1ee75786b4
3 changed files with 4 additions and 7 deletions
|
|
@ -258,8 +258,6 @@ static bool drm_format_set_extend(struct wlr_drm_format_set *dst,
|
|||
|
||||
bool wlr_drm_format_set_union(struct wlr_drm_format_set *dst,
|
||||
const struct wlr_drm_format_set *a, const struct wlr_drm_format_set *b) {
|
||||
assert(dst != a && dst != b);
|
||||
|
||||
struct wlr_drm_format_set out = {0};
|
||||
out.capacity = a->len + b->len;
|
||||
out.formats = calloc(out.capacity, sizeof(struct wlr_drm_format *));
|
||||
|
|
@ -276,6 +274,7 @@ bool wlr_drm_format_set_union(struct wlr_drm_format_set *dst,
|
|||
return false;
|
||||
}
|
||||
|
||||
wlr_drm_format_set_finish(dst);
|
||||
*dst = out;
|
||||
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue