libobs: Check return value from obs_scene_add_internal

Errors in obs_scene_add_internal would cause a crash as the null item is
passed to various signal handlers.
This commit is contained in:
Richard Stanway 2020-03-12 00:02:46 +01:00
parent 2131a8b243
commit 4dfb572547

View File

@ -1753,6 +1753,9 @@ obs_sceneitem_t *obs_scene_add(obs_scene_t *scene, obs_source_t *source)
struct calldata params;
uint8_t stack[128];
if (!item)
return NULL;
calldata_init_fixed(&params, stack, sizeof(stack));
calldata_set_ptr(&params, "scene", scene);
calldata_set_ptr(&params, "item", item);