提交 bf2df49d 编写于 作者: P Palana

libobs: Prevent registering (potentially) unsupported plugins

The rationale for rejecting these register calls is that these functions
may be required for the plugin to work properly, which can't be
guaranteed when libobs doesn't know about them.

This behavior may be revisited once the plugin manager is implemented,
to e.g. make it configurable (potentially per plugin) to allow loading
newer plugins in case they are known to work with the older libobs
上级 a26afbb9
......@@ -437,6 +437,16 @@ cleanup:
return; \
} \
\
if (size_var > sizeof(data)) { \
blog(LOG_ERROR, "Tried to register " #structure \
" with size %llu which is more " \
"than libobs currently supports " \
"(%llu)", \
(long long unsigned)size_var, \
(long long unsigned)sizeof(data));\
return; \
} \
\
memcpy(&data, info, size_var); \
da_push_back(dest, &data); \
} while (false)
......@@ -489,6 +499,14 @@ void obs_register_source_s(const struct obs_source_info *info, size_t size)
}
#undef CHECK_REQUIRED_VAL_
if (size > sizeof(data)) {
blog(LOG_ERROR, "Tried to register obs_source_info with size "
"%llu which is more than libobs currently "
"supports (%llu)", (long long unsigned)size,
(long long unsigned)sizeof(data));
return;
}
memcpy(&data, info, size);
/* mark audio-only filters as an async filter categorically */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册