From 0a816c890b86e77471c70e6e3c948492f7b08f21 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 12 Oct 2012 19:06:21 +0200 Subject: [PATCH] Fix a bug where find_nonlinear_inputs() would choke on GammaCompressionEffect and hit an infinite loop. --- effect_chain.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/effect_chain.cpp b/effect_chain.cpp index cfc6d06..1dcc463 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -111,7 +111,8 @@ void EffectChain::insert_node_between(Node *sender, Node *middle, Node *receiver void EffectChain::find_all_nonlinear_inputs(Node *node, std::vector *nonlinear_inputs) { - if (node->output_gamma_curve == GAMMA_LINEAR) { + if (node->output_gamma_curve == GAMMA_LINEAR && + node->effect->effect_type_id() != "GammaCompressionEffect") { return; } if (node->effect->num_inputs() == 0) { @@ -744,6 +745,7 @@ void EffectChain::fix_internal_gamma_by_asking_inputs(unsigned step) // See if all inputs can give us linear gamma. If not, leave it. std::vector nonlinear_inputs; find_all_nonlinear_inputs(node, &nonlinear_inputs); + assert(!nonlinear_inputs.empty()); bool all_ok = true; for (unsigned i = 0; i < nonlinear_inputs.size(); ++i) { -- 2.39.2