Commit 64e29641 authored by Stefan Agner's avatar Stefan Agner Committed by Simon Ser

screen-share: fix error handling

Make sure damage region gets properly unreferenced in error cases.
Signed-off-by: Stefan Agner's avatarStefan Agner <stefan@agner.ch>
parent 2b2c9a6f
......@@ -852,19 +852,15 @@ shared_output_repainted(struct wl_listener *listener, void *data)
pixman_image_create_bits(PIXMAN_a8r8g8b8,
width, height, NULL,
stride);
if (!so->cache_image) {
shared_output_destroy(so);
return;
}
if (!so->cache_image)
goto err_pixman_init;
pixman_region32_fini(&damage);
pixman_region32_init_rect(&damage, 0, 0, width, height);
}
if (shared_output_ensure_tmp_data(so, &damage) < 0) {
shared_output_destroy(so);
return;
}
if (shared_output_ensure_tmp_data(so, &damage) < 0)
goto err_pixman_init;
do_yflip = !!(so->output->compositor->capabilities & WESTON_CAP_CAPTURE_YFLIP);
......@@ -894,11 +890,16 @@ shared_output_repainted(struct wl_listener *listener, void *data)
}
}
pixman_region32_fini(&damage);
so->cache_dirty = 1;
pixman_region32_fini(&damage);
shared_output_update(so);
return;
err_pixman_init:
pixman_region32_fini(&damage);
shared_output_destroy(so);
}
static struct shared_output *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment