From a4724a2dd8f884fc3beaee4f49e33093069c1a35 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 18 Oct 2012 10:27:09 +0000 Subject: Fix #32905: Crash with Levels node when no input is connected. --- source/blender/compositor/nodes/COM_ViewLevelsNode.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'source/blender') diff --git a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp index 6bb873e0dec..a515bfc7f47 100644 --- a/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp +++ b/source/blender/compositor/nodes/COM_ViewLevelsNode.cpp @@ -24,6 +24,7 @@ #include "COM_ExecutionSystem.h" #include "COM_CalculateMeanOperation.h" #include "COM_CalculateStandardDeviationOperation.h" +#include "COM_SetValueOperation.h" ViewLevelsNode::ViewLevelsNode(bNode *editorNode) : Node(editorNode) { @@ -64,5 +65,18 @@ void ViewLevelsNode::convertToOperations(ExecutionSystem *graph, CompositorConte graph->addOperation(operation); } } + else { + SetValueOperation *meanOutput = new SetValueOperation(); + SetValueOperation *stdDevOutput = new SetValueOperation(); + + meanOutput->setValue(0.0f); + stdDevOutput->setValue(0.0f); + + this->getOutputSocket(0)->relinkConnections(meanOutput->getOutputSocket()); + this->getOutputSocket(1)->relinkConnections(stdDevOutput->getOutputSocket()); + + graph->addOperation(meanOutput); + graph->addOperation(stdDevOutput); + } } -- cgit v1.2.3