screen-share: Guard pixman_image_unref call on shared_output_destroy

Prevent crashes during shared_output_destroy when cache_image is not
initialized.

Signed-off-by: Pablo Saavedra <psaavedra@igalia.com>
This commit is contained in:
Pablo Saavedra 2025-08-28 11:17:33 +02:00
parent 092fe3f7ec
commit 98d4438265

View file

@ -1086,7 +1086,8 @@ shared_output_destroy(struct shared_output *so)
wl_list_remove(&so->output_destroyed.link); wl_list_remove(&so->output_destroyed.link);
wl_list_remove(&so->frame_listener.link); wl_list_remove(&so->frame_listener.link);
pixman_image_unref(so->cache_image); if (so->cache_image)
pixman_image_unref(so->cache_image);
free(so->tmp_data); free(so->tmp_data);
free(so); free(so);