mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-04-14 00:58:38 +02:00
avfilter/overlay_cuda: check av_buffer_ref result
This commit is contained in:
parent
5873e06460
commit
acb339bb88
@ -346,6 +346,8 @@ static int overlay_cuda_config_output(AVFilterLink *outlink)
|
|||||||
// initialize
|
// initialize
|
||||||
|
|
||||||
ctx->hw_device_ctx = av_buffer_ref(frames_ctx->device_ref);
|
ctx->hw_device_ctx = av_buffer_ref(frames_ctx->device_ref);
|
||||||
|
if (!ctx->hw_device_ctx)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
ctx->hwctx = ((AVHWDeviceContext*)ctx->hw_device_ctx->data)->hwctx;
|
ctx->hwctx = ((AVHWDeviceContext*)ctx->hw_device_ctx->data)->hwctx;
|
||||||
|
|
||||||
cuda_ctx = ctx->hwctx->cuda_ctx;
|
cuda_ctx = ctx->hwctx->cuda_ctx;
|
||||||
@ -354,6 +356,8 @@ static int overlay_cuda_config_output(AVFilterLink *outlink)
|
|||||||
ctx->cu_stream = ctx->hwctx->stream;
|
ctx->cu_stream = ctx->hwctx->stream;
|
||||||
|
|
||||||
outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx);
|
outlink->hw_frames_ctx = av_buffer_ref(inlink->hw_frames_ctx);
|
||||||
|
if (!outlink->hw_frames_ctx)
|
||||||
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
// load functions
|
// load functions
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user