浏览代码

libobs: Fix bug where obs_data default might not be set

If a source is created with settings, default values would not be set on
data items that already had values set.  The check here was supposed to
be a not equal rather than an equal because you're not supposed to be
able to set a default value of one type on an item that already exists
but is of a different type.

This bug would make it so that if a particular setting was removed,
there would be no default value to fall back on, and it would always be
0 or NULL for all values.

It's likely this bug wasn't encountered until now because before now
there had been no reason to clear or remove settings on most things.
jp9000 8 年之前
父节点
当前提交
9ab0f26214
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      libobs/obs-data.c

+ 1 - 1
libobs/obs-data.c

@@ -854,7 +854,7 @@ static inline void set_item_def(struct obs_data *data, obs_data_item_t **item,
 		item = &actual_item;
 	}
 
-	if (item && *item && (*item)->type == type)
+	if (item && *item && (*item)->type != type)
 		return;
 
 	set_item_data(data, item, name, ptr, size, type, true, false);