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
This commit is contained in:
Palana 2015-08-13 16:31:03 +02:00
parent a26afbb9ae
commit bf2df49d71

View File

@ -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 */