diff options
author | Todor Tomov <ttomov@mm-sol.com> | 2011-01-04 11:49:55 +0200 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2011-01-04 23:28:10 +0100 |
commit | 6971cf795cfefed91bba87c76eee0e8a28d22b7c (patch) | |
tree | b4093bd1e341d50d337bff8032a43ef15fb2d61f | |
parent | 44c981d39215a5b78f077ab758b41c6e0e8a73ef (diff) |
media.c: fix array overrun in media_entity_subtype_to_string()
Fix overrun of static arrays node_types and subdev_types in
media_entity_subtype_to_string().
Signed-off-by: Todor Tomov <ttomov@mm-sol.com>
-rw-r--r-- | media.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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: |