From b3ed50aa08bc72d8069bdd4de8ef74cd0da5e55c Mon Sep 17 00:00:00 2001 From: sorayuki Date: Wed, 8 Aug 2018 16:28:40 +0800 Subject: [PATCH] win-capture: Avoid segfault when retrieve size When changing size of a game-capture scene item in preview window, if the capture target window closed, it may crash. --- plugins/win-capture/game-capture.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/win-capture/game-capture.c b/plugins/win-capture/game-capture.c index 19bbdd3e5..12e996bac 100644 --- a/plugins/win-capture/game-capture.c +++ b/plugins/win-capture/game-capture.c @@ -1757,13 +1757,13 @@ static void game_capture_render(void *data, gs_effect_t *effect) static uint32_t game_capture_width(void *data) { struct game_capture *gc = data; - return gc->active ? gc->global_hook_info->cx : 0; + return gc->active ? gc->cx : 0; } static uint32_t game_capture_height(void *data) { struct game_capture *gc = data; - return gc->active ? gc->global_hook_info->cy : 0; + return gc->active ? gc->cy : 0; } static const char *game_capture_name(void *unused)