Commit e18ba2df authored by Anton Khirnov's avatar Anton Khirnov

hwcontext_dxva2: make sure the sw frame format is the right one during transfer

parent 5a1d605c
...@@ -315,6 +315,9 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst, ...@@ -315,6 +315,9 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
AVFrame *map; AVFrame *map;
int ret; int ret;
if (src->format != ctx->sw_format)
return AVERROR(ENOSYS);
map = av_frame_alloc(); map = av_frame_alloc();
if (!map) if (!map)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
...@@ -339,6 +342,9 @@ static int dxva2_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst, ...@@ -339,6 +342,9 @@ static int dxva2_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
ptrdiff_t src_linesize[4], dst_linesize[4]; ptrdiff_t src_linesize[4], dst_linesize[4];
int ret, i; int ret, i;
if (dst->format != ctx->sw_format)
return AVERROR(ENOSYS);
map = av_frame_alloc(); map = av_frame_alloc();
if (!map) if (!map)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment