diff options
author | Anton Khirnov <anton@khirnov.net> | 2016-11-07 13:34:21 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2016-11-18 10:31:53 +0100 |
commit | 0d3176e32f351d18d6174d8b05796829a75a4c6b (patch) | |
tree | 5c4f9e042ab3edddc230700c0463888061eeb1f5 /libavutil | |
parent | adb0e941c329a4778ade6dd0a326274472992f54 (diff) | |
download | ffmpeg-0d3176e32f351d18d6174d8b05796829a75a4c6b.tar.gz |
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')
-rw-r--r-- | libavutil/hwcontext_dxva2.c | 4 |
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; |