lavc/videotoolboxenc: fix loadVTEncSymbols crash when symbol not found

Signed-off-by: Rick Kern <kernrj@gmail.com>
This commit is contained in:
jerett 2017-06-23 08:57:18 -04:00 committed by Rick Kern
parent ea1d07aed9
commit 82a8724df2

View File

@ -73,11 +73,11 @@ static struct{
#define GET_SYM(symbol, defaultVal) \
do{ \
CFStringRef cfstr = *(CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!cfstr) \
CFStringRef* handle = (CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!handle) \
compat_keys.symbol = CFSTR(defaultVal); \
else \
compat_keys.symbol = cfstr; \
compat_keys.symbol = *handle; \
}while(0)
static pthread_once_t once_ctrl = PTHREAD_ONCE_INIT;