nsf: Don't write further than the limits of the table (size is 75, as defined in the header)

gcc 4.3.3 found this one, I'm impressed.
This commit is contained in:
Edward Hervey 2009-02-28 11:43:56 +01:00
parent 922e6428f6
commit 38d3b76d1b

View file

@ -18,7 +18,8 @@
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
/*#include "driver.h" *//* use M.A.M.E. */
/*#include "driver.h" */
/* use M.A.M.E. */
#include "fmopl.h"
#include <math.h>
@ -594,7 +595,7 @@ init_timetables (FM_OPL * OPL, int ARRATE, int DRRATE)
OPL->AR_TABLE[i] = (INT32) (rate / ARRATE);
OPL->DR_TABLE[i] = (INT32) (rate / DRRATE);
}
for (i = 60; i < 76; i++) {
for (i = 60; i < 75; i++) {
OPL->AR_TABLE[i] = EG_AED - 1;
OPL->DR_TABLE[i] = OPL->DR_TABLE[60];
}