提交 eadf7e3a 编写于 作者: J James Almer

avcodec/cuviddec: check for av_buffer_ref() failure

Signed-off-by: NJames Almer <jamrial@gmail.com>
上级 081a1799
......@@ -553,6 +553,12 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
tmp_frame->format = AV_PIX_FMT_CUDA;
tmp_frame->hw_frames_ctx = av_buffer_ref(ctx->hwframe);
if (!tmp_frame->hw_frames_ctx) {
ret = AVERROR(ENOMEM);
av_frame_free(&tmp_frame);
goto error;
}
tmp_frame->width = avctx->width;
tmp_frame->height = avctx->height;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册