From: Steinar H. Gunderson Date: Wed, 1 Jan 2014 23:25:24 +0000 (+0100) Subject: Add an assertion failure that we don't add the same effect instance twice. X-Git-Tag: 1.0~99 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=1f1da18ac6acec9e16e66441160b3949173f1db3 Add an assertion failure that we don't add the same effect instance twice. Doing this causes hard-to-understand crashes, so just bomb out at once. --- diff --git a/effect_chain.cpp b/effect_chain.cpp index f88a4f7..6b7a857 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -66,6 +66,10 @@ void EffectChain::add_output(const ImageFormat &format, OutputAlphaFormat alpha_ Node *EffectChain::add_node(Effect *effect) { + for (unsigned i = 0; i < nodes.size(); ++i) { + assert(nodes[i]->effect != effect); + } + char effect_id[256]; sprintf(effect_id, "eff%u", (unsigned)nodes.size());