Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

iOS app crash that when use h264 HW encode

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

iOS app crash that when use h264 HW encode

Postby lionxing » Sat Jun 17, 2017 8:47 am

I use ffmpeg h264 HW encode in my app , when execute "avcodec_open2()" my app crash , so I read app crash log ,find app crash in this function "GET_SYM"

#define GET_SYM(symbol, defaultVal) \
do{ \
CFStringRef cfstr = *(CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!cfstr) \
compat_keys.symbol = CFSTR(defaultVal); \
else \
compat_keys.symbol = cfstr; \
}while(0)

if dlsym(RTLD_DEFAULT, #symbol) return value is null, the * operator this null value ,app will be crash ~ so I add some logical code for fix this bug , the code like this

#define GET_SYM(symbol, defaultVal) \
do{ \
CFStringRef* cfstrptr = (CFStringRef*)dlsym(RTLD_DEFAULT, #symbol); \
if(!cfstrptr){ \
CFStringRef cfstr = *cfstrptr \
if(!cfstr) \
compat_keys.symbol = CFSTR(defaultVal); \
else \
compat_keys.symbol = cfstr; \
}else{
compat_keys.symbol = CFSTR(defaultVal);
}
}while(0)

now my app doesn't crash.
lionxing
 
Posts: 1
Joined: Sat Jun 17, 2017 8:25 am

Return to ffmpeg

Who is online

Users browsing this forum: Baidu [Spider], Bing [Bot], Google [Bot] and 7 guests