From 1dfad75870fa6b8e0a3aa41b3f9bb6ea260c9d9f Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 21 Nov 2009 00:38:16 +0000 Subject: 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 --- src/m_config.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') 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; -- cgit v1.2.3