videotoolbox: fix crash when decoding interlaced video with new API

This commit is contained in:
wm4 2017-07-11 18:24:31 +02:00
parent 0780ad9c68
commit 02d248d582
1 changed files with 1 additions and 1 deletions

View File

@ -249,7 +249,7 @@ static int videotoolbox_buffer_create(AVCodecContext *avctx, AVFrame *frame)
vtctx->cached_hw_frames_ctx = hw_frames_ctx; 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); frame->hw_frames_ctx = av_buffer_ref(vtctx->cached_hw_frames_ctx);
if (!frame->hw_frames_ctx) if (!frame->hw_frames_ctx)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);