render/drm_format_set: Clean up on union failure

If drm_format_set_extend fails, we need to make sure each wlr_drm_format
is cleaned up together with the formats array. Finish the set to take
care of it.
master
Kenny Levinsen 10 months ago
parent 484a87ce61
commit 73dd934794

@ -271,10 +271,9 @@ bool wlr_drm_format_set_union(struct wlr_drm_format_set *dst,
}
// Add both a and b sets into out
if (!drm_format_set_extend(&out, a)) {
return false;
}
if (!drm_format_set_extend(&out, b)) {
if (!drm_format_set_extend(&out, a) ||
!drm_format_set_extend(&out, b)) {
wlr_drm_format_set_finish(&out);
return false;
}

Loading…
Cancel
Save