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.
This commit is contained in:
sorayuki 2018-08-08 16:28:40 +08:00 committed by GitHub
parent 8695be6a34
commit b3ed50aa08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)