From 78016694706776fbfe4be9533704be3180b31623 Mon Sep 17 00:00:00 2001 From: Rick Kern Date: Mon, 21 Mar 2016 00:55:56 +0800 Subject: [PATCH] lavc/videotoolboxenc: Fix crash when closing codec after error Fixes crash in #5352. VTCompressionSessionInvalidate() crashes if the internal encoder hasn't completed, but hasn't experienced an error. The function call isn't needed since the encoder is invalidated when the reference count reaches 0 anyway. Signed-off-by: Rick Kern Signed-off-by: wm4 --- libavcodec/videotoolboxenc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c index 3ed1f646cf..07911469f0 100644 --- a/libavcodec/videotoolboxenc.c +++ b/libavcodec/videotoolboxenc.c @@ -1275,7 +1275,6 @@ static av_cold int vtenc_close(AVCodecContext *avctx) if(!vtctx->session) return 0; - VTCompressionSessionInvalidate(vtctx->session); pthread_cond_destroy(&vtctx->cv_sample_sent); pthread_mutex_destroy(&vtctx->lock); CFRelease(vtctx->session);