1
0
Fork 0

Stay within array limits

Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3712
This commit is contained in:
Peter Veenstra 2011-05-15 20:25:28 +00:00
parent 7f27714557
commit 8e7cbdda70
2 changed files with 7 additions and 3 deletions

View file

@ -1725,7 +1725,10 @@ Bit32u DEBUG_CheckKeys(void) {
}
if (ret<0) return ret;
if (ret>0) {
ret=(*CallBack_Handlers[ret])();
if (GCC_UNLIKELY(ret >= CB_MAX))
ret = 0;
else
ret = (*CallBack_Handlers[ret])();
if (ret) {
exitLoop=true;
CPU_Cycles=CPU_CycleLeft=0;