0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 13:08:50 +02:00

win-capture: Return early in property callbacks if param is null

When obs_get_source_properties is called, it calls the property modified
callbacks without a source instantiation. The callbacks set in
.get_properties for display capture and window capture would then result
in exceptions when anything is dereferenced on the source, such as
wgc_supported or update_mutex, because the source itself is null. Let's
make the callbacks return early if the property param is null.
This commit is contained in:
Ryan Foster 2021-06-09 18:29:41 -04:00 committed by Jim
parent 1da97fb0d0
commit 85ffdd57f4
2 changed files with 9 additions and 0 deletions

View File

@ -628,6 +628,9 @@ static bool display_capture_method_changed(obs_properties_t *props,
UNUSED_PARAMETER(p);
struct duplicator_capture *capture = obs_properties_get_param(props);
if (!capture)
return false;
update_settings(capture, settings);
update_settings_visibility(props, capture);

View File

@ -363,6 +363,9 @@ static bool wc_capture_method_changed(obs_properties_t *props,
UNUSED_PARAMETER(p);
struct window_capture *wc = obs_properties_get_param(props);
if (!wc)
return false;
update_settings(wc, settings);
update_settings_visibility(props, wc);
@ -379,6 +382,9 @@ static bool wc_window_changed(obs_properties_t *props, obs_property_t *p,
obs_data_t *settings)
{
struct window_capture *wc = obs_properties_get_param(props);
if (!wc)
return false;
update_settings(wc, settings);
update_settings_visibility(props, wc);