From dea7d65ee77bc10f93efe9be1c79a6c476b83576 Mon Sep 17 00:00:00 2001 From: Omar Emara Date: Thu, 21 Dec 2023 14:48:33 +0200 Subject: [PATCH] Fix: Crash in single value input to Glare node The Glare node crashes in the full-frame compositor when its input is a single value. Since the Glare node is constant foldable, do not inflate its input and instead output a single value. --- .../compositor/operations/COM_GlareBaseOperation.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/blender/compositor/operations/COM_GlareBaseOperation.cc b/source/blender/compositor/operations/COM_GlareBaseOperation.cc index d0cfde189f8..4cfa1ee9b3c 100644 --- a/source/blender/compositor/operations/COM_GlareBaseOperation.cc +++ b/source/blender/compositor/operations/COM_GlareBaseOperation.cc @@ -75,17 +75,14 @@ void GlareBaseOperation::update_memory_buffer(MemoryBuffer *output, { if (!is_output_rendered_) { MemoryBuffer *input = inputs[0]; - const bool is_input_inflated = input->is_a_single_elem(); - if (is_input_inflated) { - input = input->inflate(); + if (input->is_a_single_elem()) { + copy_v4_v4(output->get_elem(0, 0), input->get_elem(0, 0)); + is_output_rendered_ = true; + return; } this->generate_glare(output->get_buffer(), input, settings_); is_output_rendered_ = true; - - if (is_input_inflated) { - delete input; - } } }