diff options
author | Simon Howard | 2009-11-21 00:38:16 +0000 |
---|---|---|
committer | Simon Howard | 2009-11-21 00:38:16 +0000 |
commit | 1dfad75870fa6b8e0a3aa41b3f9bb6ea260c9d9f (patch) | |
tree | 1fdb4353460370fff15629a4f263fddcb94bbf00 /src | |
parent | f9c922149717242958f065c8718e7e7586c165a5 (diff) | |
download | chocolate-doom-1dfad75870fa6b8e0a3aa41b3f9bb6ea260c9d9f.tar.gz chocolate-doom-1dfad75870fa6b8e0a3aa41b3f9bb6ea260c9d9f.tar.bz2 chocolate-doom-1dfad75870fa6b8e0a3aa41b3f9bb6ea260c9d9f.zip |
Don't crash if key settings are set in a configuration file that are out
of range (thanks entryway).
Subversion-branch: /trunk/chocolate-doom
Subversion-revision: 1732
Diffstat (limited to 'src')
-rw-r--r-- | src/m_config.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/m_config.c b/src/m_config.c index 73f0da2c..a2f3ac58 100644 --- a/src/m_config.c +++ b/src/m_config.c @@ -1237,7 +1237,14 @@ static void LoadDefaultCollection(default_collection_t *collection) intparm = ParseIntParameter(strparm); defaults[i].untranslated = intparm; - intparm = scantokey[intparm]; + if (intparm >= 0 && intparm < 128) + { + intparm = scantokey[intparm]; + } + else + { + intparm = 0; + } defaults[i].original_translated = intparm; * (int *) def->location = intparm; |