mirror of
https://github.com/hyprwm/xdg-desktop-portal-hyprland.git
synced 2024-11-25 23:45:58 +01:00
munmap simple_frame.data only if needed in wlr_screencast.c
This commit is contained in:
parent
4c20660f74
commit
1245e9c353
1 changed files with 5 additions and 3 deletions
|
@ -105,10 +105,12 @@ static void wlr_frame_buffer(void *data, struct zwlr_screencopy_frame_v1 *frame,
|
||||||
|
|
||||||
logprint(TRACE, "wlroots: buffer event handler");
|
logprint(TRACE, "wlroots: buffer event handler");
|
||||||
cast->wlr_frame = frame;
|
cast->wlr_frame = frame;
|
||||||
if (cast->simple_frame.buffer == NULL || cast->simple_frame.width != width || cast->simple_frame.height != height || cast->simple_frame.stride != stride || cast->simple_frame.format != format) {
|
if (cast->simple_frame.buffer == NULL || cast->simple_frame.data == NULL || cast->simple_frame.width != width || cast->simple_frame.height != height || cast->simple_frame.stride != stride || cast->simple_frame.format != format) {
|
||||||
logprint(TRACE, "wlroots: buffer properties changed");
|
logprint(TRACE, "wlroots: buffer properties changed");
|
||||||
munmap(cast->simple_frame.data, cast->simple_frame.size);
|
if (cast->simple_frame.data != NULL) {
|
||||||
cast->simple_frame.data = NULL;
|
munmap(cast->simple_frame.data, cast->simple_frame.size);
|
||||||
|
cast->simple_frame.data = NULL;
|
||||||
|
}
|
||||||
cast->simple_frame.width = width;
|
cast->simple_frame.width = width;
|
||||||
cast->simple_frame.height = height;
|
cast->simple_frame.height = height;
|
||||||
cast->simple_frame.stride = stride;
|
cast->simple_frame.stride = stride;
|
||||||
|
|
Loading…
Reference in a new issue