summaryrefslogtreecommitdiff
path: root/media.c
diff options
context:
space:
mode:
Diffstat (limited to 'media.c')
-rw-r--r--media.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/media.c b/media.c
index 813a38f..75ca24c 100644
--- a/media.c
+++ b/media.c
@@ -82,12 +82,12 @@ static const char *media_entity_subtype_to_string(unsigned type)
switch (type & MEDIA_ENTITY_TYPE_MASK) {
case MEDIA_ENTITY_TYPE_NODE:
- if (subtype > ARRAY_SIZE(node_types))
+ if (subtype >= ARRAY_SIZE(node_types))
subtype = 0;
return node_types[subtype];
case MEDIA_ENTITY_TYPE_SUBDEV:
- if (subtype > ARRAY_SIZE(subdev_types))
+ if (subtype >= ARRAY_SIZE(subdev_types))
subtype = 0;
return subdev_types[subtype];
default: