[FFmpeg-devel] [PATCH] lavc/videotoolboxenc: Fix crash when closing codec after error

wm4 nfxjfg at googlemail.com
Thu Mar 24 17:37:23 CET 2016


On Mon, 21 Mar 2016 00:55:56 +0800
Rick Kern <kernrj at gmail.com> wrote:

> 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 <kernrj at gmail.com>
> ---
>  libavcodec/videotoolboxenc.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
> index 3ed1f64..0791146 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);

Seems fine. So if we don't need it, what is
VTCompressionSessionInvalidate intended for in general?


More information about the ffmpeg-devel mailing list