libobs: Fix null potential pointer dereference

When a source type has been removed (i.e. its plugin has been removed)
info can be null, which is permitted.
This commit is contained in:
jp9000 2019-08-25 19:12:46 -07:00
parent 68bdadf812
commit 2c3ea4af55

View File

@ -356,7 +356,7 @@ static obs_source_t *obs_source_create_internal(const char *id,
if (info && info->create)
source->context.data =
info->create(source->context.settings, source);
if (info->create && !source->context.data)
if ((!info || info->create) && !source->context.data)
blog(LOG_ERROR, "Failed to create source '%s'!", name);
blog(LOG_DEBUG, "%ssource '%s' (%s) created", private ? "private " : "",