summaryrefslogtreecommitdiff
path: root/libavutil/hwcontext.c
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2017-10-24 19:14:22 -0300
committerJames Almer <jamrial@gmail.com>2017-10-24 19:14:22 -0300
commit4e9dc52a9703f84a0e996263018745afa1118aa0 (patch)
treeb57070b2e4193448dccc8be1343316aa21b5899e /libavutil/hwcontext.c
parentc0683dce89eceaab8783b8b47dd2346afc0a9276 (diff)
parent1bd986ed4b0e95ded368a8eeb5c044853c090f9b (diff)
downloadffmpeg-4e9dc52a9703f84a0e996263018745afa1118aa0.tar.gz
Merge commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b'
* commit '1bd986ed4b0e95ded368a8eeb5c044853c090f9b': hwcontext: Move NONE to the be the first member of AVHWDeviceType Merged-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/hwcontext.c')
-rw-r--r--libavutil/hwcontext.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavutil/hwcontext.c b/libavutil/hwcontext.c
index 048e82126f..7f8e22736c 100644
--- a/libavutil/hwcontext.c
+++ b/libavutil/hwcontext.c
@@ -79,7 +79,8 @@ enum AVHWDeviceType av_hwdevice_find_type_by_name(const char *name)
const char *av_hwdevice_get_type_name(enum AVHWDeviceType type)
{
- if (type >= 0 && type < FF_ARRAY_ELEMS(hw_type_names))
+ if (type > AV_HWDEVICE_TYPE_NONE &&
+ type < FF_ARRAY_ELEMS(hw_type_names))
return hw_type_names[type];
else
return NULL;