summaryrefslogtreecommitdiff
path: root/src/keyboardconfig.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-03-09 18:03:56 +0300
committerAndrei Karas <akaras@inbox.ru>2012-03-18 02:34:13 +0300
commitaf6655feadc6744be9c547f341ae4fae6637b0b1 (patch)
tree9278e53f63379e951daa8e72a381f861baa9af87 /src/keyboardconfig.cpp
parenta0b036fb74fa8c6607258967f6552779c3eea60b (diff)
downloadplus-af6655feadc6744be9c547f341ae4fae6637b0b1.tar.gz
plus-af6655feadc6744be9c547f341ae4fae6637b0b1.tar.bz2
plus-af6655feadc6744be9c547f341ae4fae6637b0b1.tar.xz
plus-af6655feadc6744be9c547f341ae4fae6637b0b1.zip
Validate reading keys from config.
Diffstat (limited to 'src/keyboardconfig.cpp')
-rw-r--r--src/keyboardconfig.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/keyboardconfig.cpp b/src/keyboardconfig.cpp
index fc676dab0..0212cbf1d 100644
--- a/src/keyboardconfig.cpp
+++ b/src/keyboardconfig.cpp
@@ -395,6 +395,8 @@ void KeyboardConfig::retrieve()
{
mKey[i].value = static_cast<int>(config.getValue(
mKey[i].configField, mKey[i].defaultValue));
+ if (mKey[i].value < 0 || mKey[i].value >= SDLK_LAST)
+ mKey[i].value = KEY_NO_VALUE;
}
}
}