lavc/videotoolboxenc: fix open videotoolbox bug on iOS8.4

Checks for NULL before using object.

Signed-off-by: Rick Kern <kernrj@gmail.com>
This commit is contained in:
jerett 2017-06-23 08:58:35 -04:00 committed by Rick Kern
parent 82a8724df2
commit 9f26d670e4
1 changed files with 1 additions and 1 deletions

View File

@ -1285,7 +1285,7 @@ static av_cold int vtenc_init(AVCodecContext *avctx)
kCFAllocatorDefault,
&has_b_frames_cfbool);
if (!status) {
if (!status && has_b_frames_cfbool) {
//Some devices don't output B-frames for main profile, even if requested.
vtctx->has_b_frames = CFBooleanGetValue(has_b_frames_cfbool);
CFRelease(has_b_frames_cfbool);