mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/cuviddec: check for av_buffer_ref() failure
Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
parent
081a17990b
commit
eadf7e3a59
@ -553,6 +553,12 @@ static int cuvid_output_frame(AVCodecContext *avctx, AVFrame *frame)
|
|||||||
|
|
||||||
tmp_frame->format = AV_PIX_FMT_CUDA;
|
tmp_frame->format = AV_PIX_FMT_CUDA;
|
||||||
tmp_frame->hw_frames_ctx = av_buffer_ref(ctx->hwframe);
|
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->width = avctx->width;
|
||||||
tmp_frame->height = avctx->height;
|
tmp_frame->height = avctx->height;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user