From 9ab0f2621412f680078a016607ee9a3b3790a1e6 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Mon, 26 Jun 2017 16:51:48 -0700 Subject: [PATCH] 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. --- libobs/obs-data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libobs/obs-data.c b/libobs/obs-data.c index efd406a50..870de336c 100644 --- a/libobs/obs-data.c +++ b/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);