backend-pipewire: Move region initialization at the start

Failure to do so, might cause a crash if the output repaint happens
before the pipewire pipeline started -- calling pixman_region32_fini on
a uninitialized region.

Fixes 2abe4efcf7, "libweston/backends: Move damage flush into backends"

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
This commit is contained in:
Marius Vlad 2024-03-07 11:05:17 +02:00 committed by Derek Foreman
parent 4861b19f3d
commit b93335a741
1 changed files with 2 additions and 2 deletions

View File

@ -735,11 +735,11 @@ pipewire_output_repaint(struct weston_output *base)
assert(output);
pixman_region32_init(&damage);
if (pw_stream_get_state(output->stream, NULL) != PW_STREAM_STATE_STREAMING)
goto out;
pixman_region32_init(&damage);
weston_output_flush_damage_for_primary_plane(base, &damage);
if (!pixman_region32_not_empty(&damage))