From 493d4b22ed82a7a265f0f88a568df9518b7ad50e Mon Sep 17 00:00:00 2001 From: Alexander Irion Date: Tue, 11 Aug 2020 12:53:21 +0200 Subject: Fix crash in controller_screenshot_notify With the following change in weston-8 the wl_signal_emit's data parameter has been changed from output to output_damge: https://github.com/wayland-project/weston/commit/0bb94476532ebbe95e255a9a736ee0c48866db53 has changed wl_signal_emit(&output->frame_signal, output); => wl_signal_emit(&output->frame_signal, output_damage); The function controller_screenshot_notify in ivi-controller.c interprets the data parameter as output, which causes winston to crash. With this chage, the output is now stored in the screenshot_frame_listener struct and controller_screenshot_notify uses the stored value, instead of the signal's data parameter. --- weston-ivi-shell/src/ivi-controller.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'weston-ivi-shell') diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c index cabd31b..629e673 100644 --- a/weston-ivi-shell/src/ivi-controller.c +++ b/weston-ivi-shell/src/ivi-controller.c @@ -86,6 +86,7 @@ struct screenshot_frame_listener { struct wl_listener frame_listener; struct wl_listener output_destroyed; struct wl_resource *screenshot; + struct weston_output *output; }; struct screen_id_info { @@ -1206,7 +1207,7 @@ controller_screenshot_notify(struct wl_listener *listener, void *data) struct screenshot_frame_listener *l = wl_container_of(listener, l, frame_listener); - struct weston_output *output = data; + struct weston_output *output = l->output; int32_t width = 0; int32_t height = 0; int32_t stride = 0; @@ -1336,6 +1337,8 @@ controller_screen_screenshot(struct wl_client *client, return; } + l->output = iviscrn->output; + wl_resource_set_implementation(l->screenshot, NULL, l, screenshot_frame_listener_destroy); l->output_destroyed.notify = screenshot_output_destroyed; -- cgit v1.2.1