Просмотр исходного кода

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.
jp9000 6 лет назад
Родитель
Сommit
2c3ea4af55
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      libobs/obs-source.c

+ 1 - 1
libobs/obs-source.c

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