From 02d248d5828dbbfecfb37597c626900f41448bea Mon Sep 17 00:00:00 2001 From: wm4 Date: Tue, 11 Jul 2017 18:24:31 +0200 Subject: [PATCH] videotoolbox: fix crash when decoding interlaced video with new API --- libavcodec/videotoolbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavcodec/videotoolbox.c b/libavcodec/videotoolbox.c index 1b1be41934..dd13e2581b 100644 --- a/libavcodec/videotoolbox.c +++ b/libavcodec/videotoolbox.c @@ -249,7 +249,7 @@ static int videotoolbox_buffer_create(AVCodecContext *avctx, AVFrame *frame) vtctx->cached_hw_frames_ctx = hw_frames_ctx; } - av_assert0(!frame->hw_frames_ctx); + av_buffer_unref(&frame->hw_frames_ctx); frame->hw_frames_ctx = av_buffer_ref(vtctx->cached_hw_frames_ctx); if (!frame->hw_frames_ctx) return AVERROR(ENOMEM);