From c0324a9e6df3b472b5483803983e8831f3777a44 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Wed, 21 Aug 2002 17:13:17 +0000 Subject: fixed one-off-error (I hope this fix is right?); use calloc instead of malloc to ensure struct is zeroed svn-id: r4795 --- sound/fmopl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sound/fmopl.cpp') 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 */ -- cgit v1.2.3