diff options
author | Alexander Irion <alexander_irion@mentor.com> | 2020-08-11 12:53:21 +0200 |
---|---|---|
committer | Tran Ba Khang(MS/EMC31-XC) <Khang.TranBa@vn.bosch.com> | 2023-01-13 10:32:46 +0700 |
commit | 493d4b22ed82a7a265f0f88a568df9518b7ad50e (patch) | |
tree | ff3957e08850da3a9d4237ac71dad038400649a5 /weston-ivi-shell | |
parent | 40596515569210b603caff702568681659c05fec (diff) | |
download | wayland-ivi-extension-493d4b22ed82a7a265f0f88a568df9518b7ad50e.tar.gz |
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.
Diffstat (limited to 'weston-ivi-shell')
-rw-r--r-- | weston-ivi-shell/src/ivi-controller.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; |