summaryrefslogtreecommitdiffstats
path: root/libavutil
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-07 14:12:17 +0100
committerAnton Khirnov <anton@khirnov.net>2016-11-18 10:31:53 +0100
commite18ba2dfd2d19aedc8afccf011d5fd0833352423 (patch)
treefc28e01f79755af46735293a82ae501e30bc875c /libavutil
parent5a1d605ceae448b476a525f7368ec452000d1f26 (diff)
downloadffmpeg-streaming-e18ba2dfd2d19aedc8afccf011d5fd0833352423.zip
ffmpeg-streaming-e18ba2dfd2d19aedc8afccf011d5fd0833352423.tar.gz
hwcontext_dxva2: make sure the sw frame format is the right one during transfer
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/hwcontext_dxva2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 3fe19a6..ccf03c8 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -315,6 +315,9 @@ static int dxva2_transfer_data_to(AVHWFramesContext *ctx, AVFrame *dst,
AVFrame *map;
int ret;
+ if (src->format != ctx->sw_format)
+ return AVERROR(ENOSYS);
+
map = av_frame_alloc();
if (!map)
return AVERROR(ENOMEM);
@@ -339,6 +342,9 @@ static int dxva2_transfer_data_from(AVHWFramesContext *ctx, AVFrame *dst,
ptrdiff_t src_linesize[4], dst_linesize[4];
int ret, i;
+ if (dst->format != ctx->sw_format)
+ return AVERROR(ENOSYS);
+
map = av_frame_alloc();
if (!map)
return AVERROR(ENOMEM);
OpenPOWER on IntegriCloud