Permalink
Browse files

Fixed a array out of bounds error, due to a off by one mistake.

  • Loading branch information...
1 parent e96bae1 commit 9eccc8df884442846466d37e37df1e67b3217b4b @bramp committed Mar 11, 2012
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/main.cpp
View
@@ -106,7 +106,7 @@ const std::vector<__u16> & Main::setupUinputMap() {
static std::vector<__u16> uinputCecMap;
if (uinputCecMap.empty()) {
- uinputCecMap.resize(CEC_USER_CONTROL_CODE_MAX, KEY_RESERVED);
+ uinputCecMap.resize(CEC_USER_CONTROL_CODE_MAX + 1, 0);
uinputCecMap[CEC_USER_CONTROL_CODE_SELECT ] = KEY_ENTER;
uinputCecMap[CEC_USER_CONTROL_CODE_UP ] = KEY_UP;
uinputCecMap[CEC_USER_CONTROL_CODE_DOWN ] = KEY_DOWN;
@@ -186,7 +186,6 @@ const std::vector<__u16> & Main::setupUinputMap() {
uinputCecMap[CEC_USER_CONTROL_CODE_F5 ] = 0;
uinputCecMap[CEC_USER_CONTROL_CODE_DATA ] = 0;
uinputCecMap[CEC_USER_CONTROL_CODE_AN_RETURN ] = 0;
- uinputCecMap[CEC_USER_CONTROL_CODE_MAX ] = 0;
}
return uinputCecMap;

0 comments on commit 9eccc8d

Please sign in to comment.