summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext_dxva2.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2016-11-07 13:34:21 +0100
committerAnton Khirnov <anton@khirnov.net>2016-11-18 10:31:53 +0100
commit0d3176e32f351d18d6174d8b05796829a75a4c6b (patch)
tree5c4f9e042ab3edddc230700c0463888061eeb1f5 /libavutil/hwcontext_dxva2.c
parentadb0e941c329a4778ade6dd0a326274472992f54 (diff)
hwcontext_dxva2: do not assume the destination format during mapping is always the right one
Handle the cases where it is unsupported or unset.
Diffstat (limited to 'libavutil/hwcontext_dxva2.c')
-rw-r--r--libavutil/hwcontext_dxva2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavutil/hwcontext_dxva2.c b/libavutil/hwcontext_dxva2.c
index 600cf0eec7..8a050719b7 100644
--- a/libavutil/hwcontext_dxva2.c
+++ b/libavutil/hwcontext_dxva2.c
@@ -345,6 +345,10 @@ static int dxva2_map_from(AVHWFramesContext *ctx,
{
int err;
+ if (dst->format != AV_PIX_FMT_NONE && dst->format != ctx->sw_format)
+ return AVERROR(ENOSYS);
+ dst->format = ctx->sw_format;
+
err = dxva2_map_frame(ctx, dst, src, flags);
if (err < 0)
return err;