From 53d385a596d60b542a51b3fdfbd0b21bbfff2b15 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 9 Jan 2016 21:10:12 +0100 Subject: [PATCH 1/2] - need to validate SetSectorTerrain's 'plane' parameter, --- src/p_acs.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index c40ba6b94..87641efe2 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5973,15 +5973,19 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) case ACSF_SetSectorTerrain: if (argCount >= 3) { - int terrain = P_FindTerrain(FBehavior::StaticLookupString(args[2])); - FSectorTagIterator it(args[0]); - int s; - while ((s = it.Next()) >= 0) + if (args[1] == sector_t::floor || args[1] == sector_t::ceiling) { - sectors[s].terrainnum[args[1]] = terrain; + int terrain = P_FindTerrain(FBehavior::StaticLookupString(args[2])); + FSectorTagIterator it(args[0]); + int s; + while ((s = it.Next()) >= 0) + { + sectors[s].terrainnum[args[1]] = terrain; + } } } - + break; + default: break; } From 1f34372abcac269539f7f0617b77788b8a16447e Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sat, 9 Jan 2016 17:53:47 -0600 Subject: [PATCH 2/2] Remove the upper limit on midi_voices. - Black MIDIs can be brutal, and there's really no reason that this needs to be artificially limited to a paltry 256 voices. --- src/timidity/timidity.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timidity/timidity.cpp b/src/timidity/timidity.cpp index 807bc07b7..440db9211 100644 --- a/src/timidity/timidity.cpp +++ b/src/timidity/timidity.cpp @@ -698,7 +698,7 @@ Renderer::Renderer(float sample_rate, const char *args) if (def_instr_name.IsNotEmpty()) set_default_instrument(def_instr_name); - voices = clamp(midi_voices, 16, 256); + voices = MAX(*midi_voices, 16); voice = new Voice[voices]; drumchannels = DEFAULT_DRUMCHANNELS; }