diff options
author | Timo Rothenpieler <timo@rothenpieler.org> | 2020-04-06 19:33:01 +0200 |
---|---|---|
committer | Timo Rothenpieler <timo@rothenpieler.org> | 2020-04-06 19:33:01 +0200 |
commit | 30b28f9a83ec095f5684fecb04a42619a6675989 (patch) | |
tree | 801c41adefb2076ba10e97ac4f1a738c4b70e006 /libavutil/hwcontext_cuda.c | |
parent | 741565a1e69c45ce4848f01e45be5e66a68efa2f (diff) | |
download | ffmpeg-30b28f9a83ec095f5684fecb04a42619a6675989.tar.gz |
avutil/hwcontext_cuda: Only handle CUDA hardware frames
Diffstat (limited to 'libavutil/hwcontext_cuda.c')
-rw-r--r-- | libavutil/hwcontext_cuda.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/hwcontext_cuda.c b/libavutil/hwcontext_cuda.c index 95402a1460..58d128a280 100644 --- a/libavutil/hwcontext_cuda.c +++ b/libavutil/hwcontext_cuda.c @@ -212,6 +212,10 @@ static int cuda_transfer_data(AVHWFramesContext *ctx, AVFrame *dst, CUcontext dummy; int i, ret; + if ((src->hw_frames_ctx && ((AVHWFramesContext*)src->hw_frames_ctx->data)->format != AV_PIX_FMT_CUDA) || + (dst->hw_frames_ctx && ((AVHWFramesContext*)dst->hw_frames_ctx->data)->format != AV_PIX_FMT_CUDA)) + return AVERROR(ENOSYS); + ret = CHECK_CU(cu->cuCtxPushCurrent(hwctx->cuda_ctx)); if (ret < 0) return ret; |