aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2002-08-21 17:13:17 +0000
committerMax Horn2002-08-21 17:13:17 +0000
commitc0324a9e6df3b472b5483803983e8831f3777a44 (patch)
tree7478c0dbb464de42c113368f84c35d2c2b09c061
parent2ebd2ba0b5094f87e134745c21055a3af6440afc (diff)
downloadscummvm-rg350-c0324a9e6df3b472b5483803983e8831f3777a44.tar.gz
scummvm-rg350-c0324a9e6df3b472b5483803983e8831f3777a44.tar.bz2
scummvm-rg350-c0324a9e6df3b472b5483803983e8831f3777a44.zip
fixed one-off-error (I hope this fix is right?); use calloc instead of malloc to ensure struct is zeroed
svn-id: r4795
-rw-r--r--sound/fmopl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/fmopl.cpp b/sound/fmopl.cpp
index 81bc3da313..3942a05566 100644
--- a/sound/fmopl.cpp
+++ b/sound/fmopl.cpp
@@ -564,7 +564,7 @@ static void init_timetables( FM_OPL *OPL , int ARRATE , int DRRATE )
OPL->AR_TABLE[i] = (int)(rate / ARRATE);
OPL->DR_TABLE[i] = (int)(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];
@@ -1038,7 +1038,7 @@ FM_OPL *OPLCreate(int type, int clock, int rate)
state_size += sizeof(OPL_CH)*max_ch;
/* allocate memory block */
- ptr = (char *)malloc(state_size);
+ ptr = (char *)calloc(state_size, 1);
if(ptr==NULL) return NULL;
/* clear */