aboutsummaryrefslogtreecommitdiffstats
path: root/libavutil/hwcontext_vaapi.c
diff options
context:
space:
mode:
authorHaihao Xiang <haihao.xiang@intel.com>2018-05-10 11:08:23 +0800
committerMark Thompson <sw@jkqxz.net>2018-05-10 19:52:53 +0100
commitbed670a1de29b58fcb3fe046562d8bd125b1457f (patch)
tree5253a40ef4aec59262ccf8c253220ed055aa7b01 /libavutil/hwcontext_vaapi.c
parent7e78801fa5802dd49712d2b1fdb8bb31d8373ecc (diff)
downloadffmpeg-bed670a1de29b58fcb3fe046562d8bd125b1457f.tar.gz
hwcontext_vaapi: Add an assert in vaapi_map_from_drm()
Every fourcc in vaapi_drm_format_map should be in vaapi_format_map, so add an assert to ensure we have the right maps. Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
Diffstat (limited to 'libavutil/hwcontext_vaapi.c')
-rw-r--r--libavutil/hwcontext_vaapi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavutil/hwcontext_vaapi.c b/libavutil/hwcontext_vaapi.c
index 7daaa951cc..e55bb8db3f 100644
--- a/libavutil/hwcontext_vaapi.c
+++ b/libavutil/hwcontext_vaapi.c
@@ -1028,6 +1028,8 @@ static int vaapi_map_from_drm(AVHWFramesContext *src_fc, AVFrame *dst,
va_rt_format = vaapi_format_map[i].rt_format;
}
+ av_assert0(i < FF_ARRAY_ELEMS(vaapi_format_map));
+
buffer_handle = desc->objects[0].fd;
buffer_desc.pixel_format = va_fourcc;
buffer_desc.width = src_fc->width;