From 2a6cfef07eeadc265fffe9f623564fcfb896b78f Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Tue, 3 Dec 2019 18:32:05 -0300 Subject: [PATCH] screen-share: define variable type before using as function argument Define the void pointer as pixman_region32_t instead of using it directly. Void pointers are used by generic API's so each user can define a data type as needed. Not doing this is dangerous, since void pointers implicitly cast from/to any pointer without giving warnings. So we must define its type instead of using it directly in a function call. Signed-off-by: Leandro Ribeiro --- compositor/screen-share.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compositor/screen-share.c b/compositor/screen-share.c index a2b21594..c8256fac 100644 --- a/compositor/screen-share.c +++ b/compositor/screen-share.c @@ -819,6 +819,7 @@ shared_output_repainted(struct wl_listener *listener, void *data) struct shared_output *so = container_of(listener, struct shared_output, frame_listener); pixman_region32_t damage; + pixman_region32_t *current_damage = data; struct ss_shm_buffer *sb; int32_t x, y, width, height, stride; int i, nrects, do_yflip, y_orig; @@ -847,7 +848,7 @@ shared_output_repainted(struct wl_listener *listener, void *data) } else { /* Damage in output coordinates */ pixman_region32_init(&damage); - pixman_region32_intersect(&damage, &so->output->region, data); + pixman_region32_intersect(&damage, &so->output->region, current_damage); pixman_region32_translate(&damage, -so->output->x, -so->output->y); }