diff -ruN TiMidity++-2.8.0/ChangeLog TiMidity++-2.8.1/ChangeLog --- TiMidity++-2.8.0/ChangeLog Wed Nov 24 10:56:16 1999 +++ TiMidity++-2.8.1/ChangeLog Mon Nov 29 11:59:52 1999 @@ -1,3 +1,21 @@ +1999-11-29 Masanao Izumo + + * Version 2.8.1 released. + +1999-11-29 Masanao Izumo + + * timidity/timidity.c,interface/{gtk_c.c,motif_c.c,w32g_i.c,w32g_util.c, + w32g_ini.c,wrdt_wcon.c,xaw_c.c}: Bug fixes about over-running in strncpy. + +1999-11-24 Masanao Izumo + + * configure.in: Fix typoes + +1999-11-19 Eric A. Welsh + + * timidity/playmidi.c (reduce_voice_CPU): Obsoleted. Use reduce_voice() + instead of reduce_voice_CPU(). + 1999-11-24 Masanao Izumo * Version 2.8.0 released. @@ -45,7 +63,7 @@ wave interpolation in resampling. --enable-spline=linear Linear interpolation (default) --enable-spline=cubic Cubic interpolation - --enable-spline=lanrange Langrange interpolation + --enable-spline=lagrange Lagrange interpolation --enable-spline=no No interplation 1999-11-12 Masanao Izumo diff -ruN TiMidity++-2.8.0/NEWS TiMidity++-2.8.1/NEWS --- TiMidity++-2.8.0/NEWS Wed Nov 24 12:04:28 1999 +++ TiMidity++-2.8.1/NEWS Mon Nov 29 11:34:43 1999 @@ -1,3 +1,6 @@ +11/29, 1999 + * Version 2.8.1 released. + 11/24, 1999 * Version 2.8.0 released. * In GTK, added support for printing the lyrics from .kar files @@ -13,7 +16,7 @@ * New configure option to choose wave interpolation in resampling. --with-spline=linear Linear interpolation (default) --with-spline=cubic Cubic interpolation - --with-spline=lanrange Langrange interpolation + --with-spline=lagrange Lagrange interpolation --with-spline=no No interplation * New command line option `-m N' to specify sustain time (msec). -m 1 Effectively behaves as if all sustains are ignored, diff -ruN TiMidity++-2.8.0/configs/msc-config.h TiMidity++-2.8.1/configs/msc-config.h --- TiMidity++-2.8.0/configs/msc-config.h Wed Nov 24 12:26:01 1999 +++ TiMidity++-2.8.1/configs/msc-config.h Mon Nov 29 11:59:44 1999 @@ -217,7 +217,7 @@ #define HAVE_MMSYSTEM_H /* In VDS Macro AAA=BBB is not available. */ -#define TIMID_VERSION "2.8.0" +#define TIMID_VERSION "2.8.1" #define DEFAULT_PATH ".\\" #define AU_W32 #define WINSOCK diff -ruN TiMidity++-2.8.0/configure TiMidity++-2.8.1/configure --- TiMidity++-2.8.0/configure Wed Nov 24 10:32:24 1999 +++ TiMidity++-2.8.1/configure Fri Nov 26 18:04:15 1999 @@ -110,7 +110,7 @@ ac_help="$ac_help --enable-spectrogram Enable Sound Spectrogram Viewer (default is no)" ac_help="$ac_help - --enable-spline=[method] Specify spline method: no|linear|cubic|lanrange + --enable-spline=[method] Specify spline method: no|linear|cubic|lagrange (default is linear)" ac_help="$ac_help --enable-wrd Enable WRD interface for X (default is no)" @@ -884,7 +884,7 @@ PACKAGE=TiMidity++ -VERSION=2.8.0 +VERSION=2.8.1 if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } @@ -7638,7 +7638,7 @@ xcubic) EXTRADEFS="$EXTRADEFS -DCSPLINE_INTERPOLATION" ;; - xlanrange) + xlagrange) EXTRADEFS="$EXTRADEFS -DLAGRANGE_INTERPOLATION" ;; xno) diff -ruN TiMidity++-2.8.0/configure.in TiMidity++-2.8.1/configure.in --- TiMidity++-2.8.0/configure.in Wed Nov 24 10:32:06 1999 +++ TiMidity++-2.8.1/configure.in Fri Nov 26 18:04:09 1999 @@ -55,7 +55,7 @@ AC_INIT(timidity/timidity.c) SHELL=${CONFIG_SHELL-/bin/sh} AC_CANONICAL_SYSTEM -AM_INIT_AUTOMAKE(TiMidity++, 2.8.0, no-define) +AM_INIT_AUTOMAKE(TiMidity++, 2.8.1, no-define) dnl To use CONTAINS() macro (See acinclude.m4) CONTAINS_INIT @@ -1223,7 +1223,7 @@ dnl Wave Spline Interpolations AC_ARG_ENABLE(spline, - [ --enable-spline=[method] Specify spline method: no|linear|cubic|lanrange + [ --enable-spline=[method] Specify spline method: no|linear|cubic|lagrange (default is linear)], [ case "x$enableval" in xlinear) @@ -1232,7 +1232,7 @@ xcubic) EXTRADEFS="$EXTRADEFS -DCSPLINE_INTERPOLATION" ;; - xlanrange) + xlagrange) EXTRADEFS="$EXTRADEFS -DLAGRANGE_INTERPOLATION" ;; xno) diff -ruN TiMidity++-2.8.0/interface/gtk_c.c TiMidity++-2.8.1/interface/gtk_c.c --- TiMidity++-2.8.0/interface/gtk_c.c Fri Nov 12 13:25:10 1999 +++ TiMidity++-2.8.1/interface/gtk_c.c Mon Nov 29 11:41:57 1999 @@ -387,14 +387,14 @@ } else { - strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf)); + strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1); gtk_pipe_int_write(LYRIC_MESSAGE); gtk_pipe_string_write(lyric_buf); } } else { - strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf)); + strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1); gtk_pipe_int_write(LYRIC_MESSAGE); gtk_pipe_string_write(lyric_buf); } diff -ruN TiMidity++-2.8.0/interface/motif_c.c TiMidity++-2.8.1/interface/motif_c.c --- TiMidity++-2.8.0/interface/motif_c.c Sat Mar 27 02:11:40 1999 +++ TiMidity++-2.8.1/interface/motif_c.c Mon Nov 29 11:42:18 1999 @@ -184,14 +184,14 @@ } else { - strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf)); + strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1); m_pipe_int_write(LYRIC_MESSAGE); m_pipe_string_write(lyric_buf); } } else { - strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf)); + strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1); m_pipe_int_write(LYRIC_MESSAGE); m_pipe_string_write(lyric_buf); } diff -ruN TiMidity++-2.8.0/interface/w32g_i.c TiMidity++-2.8.1/interface/w32g_i.c --- TiMidity++-2.8.0/interface/w32g_i.c Mon Sep 27 21:44:31 1999 +++ TiMidity++-2.8.1/interface/w32g_i.c Mon Nov 29 11:45:06 1999 @@ -3244,7 +3244,7 @@ if(!itemidlist) return; /* Cancel */ SHGetPathFromIDList(itemidlist, Buffer); - strncpy(biBuffer, Buffer, sizeof(biBuffer)); + strncpy(biBuffer, Buffer, sizeof(Buffer) - 1); w32g_lock_open_file = 1; directory_form(Buffer); w32g_send_rc(RC_EXT_LOAD_FILE, (int32)Buffer); diff -ruN TiMidity++-2.8.0/interface/w32g_ini.c TiMidity++-2.8.1/interface/w32g_ini.c --- TiMidity++-2.8.0/interface/w32g_ini.c Tue Oct 12 14:53:44 1999 +++ TiMidity++-2.8.1/interface/w32g_ini.c Mon Nov 29 11:51:35 1999 @@ -116,7 +116,7 @@ IniGetKeyInt(INI_SEC_TIMIDITY,"opt_channel_pressure",&(st->opt_channel_pressure)); IniGetKeyInt(INI_SEC_TIMIDITY,"opt_trace_text_meta_event",&(st->opt_trace_text_meta_event)); IniGetKeyInt(INI_SEC_TIMIDITY,"opt_overlap_voice_allow",&(st->opt_overlap_voice_allow)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_default_mid",buff,sizeof(buff)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_default_mid",buff,sizeof(buff)-1); st->opt_default_mid = str2mID(buff); IniGetKeyInt(INI_SEC_TIMIDITY,"default_tonebank",&(st->default_tonebank)); IniGetKeyInt(INI_SEC_TIMIDITY,"special_tonebank",&(st->special_tonebank)); @@ -134,22 +134,22 @@ st->spectrogram_update_sec = v_float; #endif IniGetKeyIntArray(INI_SEC_TIMIDITY,"default_program",st->default_program,MAX_CHANNELS); - IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_ctl",st->opt_ctl,sizeof(st->opt_ctl)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_ctl",st->opt_ctl,sizeof(st->opt_ctl)-1); IniGetKeyInt(INI_SEC_TIMIDITY,"opt_realtime_playing",&(st->opt_realtime_playing)); IniGetKeyInt(INI_SEC_TIMIDITY,"reduce_voice_threshold",&(st->reduce_voice_threshold)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_playmode",st->opt_playmode,sizeof(st->opt_playmode)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"OutputName",st->OutputName,sizeof(st->OutputName)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_playmode",st->opt_playmode,sizeof(st->opt_playmode)-1); + IniGetKeyStringN(INI_SEC_TIMIDITY,"OutputName",st->OutputName,sizeof(st->OutputName)-1); IniGetKeyInt(INI_SEC_TIMIDITY,"voices",&(st->voices)); IniGetKeyInt(INI_SEC_TIMIDITY,"auto_reduce_polyphony",&(st->auto_reduce_polyphony)); IniGetKeyInt32(INI_SEC_TIMIDITY,"quietchannels",(int32 *)&(st->quietchannels)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_qsize",st->opt_qsize,sizeof(st->opt_qsize)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"opt_qsize",st->opt_qsize,sizeof(st->opt_qsize)-1); IniGetKeyInt32(INI_SEC_TIMIDITY,"modify_release",&(st->modify_release)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"allocate_cache_size",buff,sizeof(buff)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"allocate_cache_size",buff,sizeof(buff)-1); st->allocate_cache_size = str2size(buff); IniGetKeyInt(INI_SEC_TIMIDITY,"output_rate",&(st->output_rate)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"output_text_code",st->output_text_code,sizeof(st->output_text_code)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"output_text_code",st->output_text_code,sizeof(st->output_text_code)-1); IniGetKeyInt(INI_SEC_TIMIDITY,"free_instruments_afterwards",&(st->free_instruments_afterwards)); - IniGetKeyStringN(INI_SEC_TIMIDITY,"out_wrd",st->opt_wrd,sizeof(st->opt_wrd)); + IniGetKeyStringN(INI_SEC_TIMIDITY,"out_wrd",st->opt_wrd,sizeof(st->opt_wrd)-1); #if defined(__W32__) && defined(SMFCONV) IniGetKeyInt(INI_SEC_TIMIDITY,"opt_rcpcv_dll",&(st->opt_rcpcv_dll)); #endif diff -ruN TiMidity++-2.8.0/interface/w32g_utl.c TiMidity++-2.8.1/interface/w32g_utl.c --- TiMidity++-2.8.0/interface/w32g_utl.c Fri Sep 3 13:58:02 1999 +++ TiMidity++-2.8.1/interface/w32g_utl.c Mon Nov 29 11:50:36 1999 @@ -563,7 +563,7 @@ if(play_mode->encoding & PE_BYTESWAP) st->opt_playmode[j++] = 'x'; st->opt_playmode[j] = '\0'; - strncpy(st->OutputName,OutputName,sizeof(st->OutputName)); + strncpy(st->OutputName,OutputName,sizeof(st->OutputName)-1); st->voices = SetValue(voices, 1, MAX_VOICES); st->auto_reduce_polyphony = auto_reduce_polyphony; st->quietchannels = quietchannels; @@ -579,11 +579,11 @@ st->output_rate = DEFAULT_RATE; } st->output_rate = SetValue(st->output_rate,MIN_OUTPUT_RATE,MAX_OUTPUT_RATE); - strncpy(st->output_text_code,output_text_code,sizeof(st->output_text_code)); + strncpy(st->output_text_code,output_text_code,sizeof(st->output_text_code)-1); st->free_instruments_afterwards = free_instruments_afterwards; st->opt_wrd[0] = wrdt->id; if(wrdt_open_opts) - strncpy(st->opt_wrd + 1, wrdt_open_opts, sizeof(st->opt_wrd) - 1); + strncpy(st->opt_wrd + 1, wrdt_open_opts, sizeof(st->opt_wrd) - 2); else st->opt_wrd[1] = '\0'; #if defined(__W32__) && defined(SMFCONV) @@ -745,7 +745,7 @@ int IniVersionCheck(void) { char version[INI_MAXLEN]; - if(IniGetKeyStringN(INI_SEC_PLAYER,"IniVersion",version,sizeof(version)) == 0 && + if(IniGetKeyStringN(INI_SEC_PLAYER,"IniVersion",version,sizeof(version)-1) == 0 && strcmp(version, IniVersion) == 0) return 1; // UnChanged return 0; diff -ruN TiMidity++-2.8.0/interface/wrdt_wcon.c TiMidity++-2.8.1/interface/wrdt_wcon.c --- TiMidity++-2.8.0/interface/wrdt_wcon.c Thu Mar 11 14:57:58 1999 +++ TiMidity++-2.8.1/interface/wrdt_wcon.c Mon Nov 29 11:52:34 1999 @@ -757,7 +757,7 @@ char local[201]; local[0] = '\033'; local[1] = '['; - strncpy(local+2,str,200-2); + strncpy(local+2,str,sizeof(local)-3); local[200] = '\0'; putstring_with_esc(local); } diff -ruN TiMidity++-2.8.0/interface/xaw_c.c TiMidity++-2.8.1/interface/xaw_c.c --- TiMidity++-2.8.0/interface/xaw_c.c Sat Aug 7 19:49:27 1999 +++ TiMidity++-2.8.1/interface/xaw_c.c Mon Nov 29 11:53:28 1999 @@ -263,13 +263,13 @@ else if(lyric[2] == 'T') snprintf(lyric_buf, sizeof(lyric_buf), "Title: %s", lyric + 3); else - strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf)); + strncpy(lyric_buf, lyric + 1, sizeof(lyric_buf) - 1); a_pipe_write_msg(lyric_buf); lyric_col = 0; } else { - strncpy(lyric_buf + lyric_col, lyric + 1, sizeof(lyric_buf) - lyric_col); + strncpy(lyric_buf + lyric_col, lyric + 1, sizeof(lyric_buf) - lyric_col - 1); a_pipe_write_msg(lyric_buf); lyric_col += strlen(lyric + 1); } diff -ruN TiMidity++-2.8.0/timidity/playmidi.c TiMidity++-2.8.1/timidity/playmidi.c --- TiMidity++-2.8.0/timidity/playmidi.c Wed Nov 24 12:25:08 1999 +++ TiMidity++-2.8.1/timidity/playmidi.c Fri Nov 26 11:42:11 1999 @@ -701,6 +701,11 @@ return ip; } +#if 0 +/* reduce_voice_CPU() may not have any speed advantage over reduce_voice(). + * So this function is not used, now. + */ + /* The goal of this routine is to free as much CPU as possible without loosing too much sound quality. We would like to know how long a note has been playing, but since we usually can't calculate this, we guess at @@ -928,6 +933,7 @@ return lowest; } +#endif /* this reduces voices while maintaining sound quality */ static int reduce_voice(void) @@ -3691,14 +3697,7 @@ } for(i = 0; i < kill_nv; i++) - { - v = reduce_voice_CPU(); - - /* Tell VOICE_DIE to interface */ - voice[v].status = VOICE_DIE; - ctl_note_event(v); - free_voice(v); - } + v = reduce_voice(); /* lower max # of allowed voices to let the buffer recover */ if (auto_reduce_polyphony) { diff -ruN TiMidity++-2.8.0/timidity/timidity.c TiMidity++-2.8.1/timidity/timidity.c --- TiMidity++-2.8.0/timidity/timidity.c Fri Nov 19 10:11:24 1999 +++ TiMidity++-2.8.1/timidity/timidity.c Mon Nov 29 11:40:35 1999 @@ -2854,7 +2854,7 @@ extern char *ConfigFile; if(!ConfigFile[0]) strcpy(ConfigFile, W32G_TIMIDITY_CFG); - strncpy(local, ConfigFile, sizeof(local)); + strncpy(local, ConfigFile, sizeof(local) - 1); #else /* !IA_W32GUI */ GetWindowsDirectory(local, 1023 - 13); @@ -3285,7 +3285,7 @@ #ifdef IA_W32GUI { extern char *ConfigFile; - strncpy(config1, ConfigFile, sizeof(config1)); + strncpy(config1, ConfigFile, sizeof(config1) - 1); } #else /* !IA_W32GUI */