Skip to content

Commit

Permalink
GradeBeauty : unwanted channels could slip into the engine and produc…
Browse files Browse the repository at this point in the history
…e a segfault. (#8)
  • Loading branch information
sebjacob authored Jan 27, 2020
1 parent 59c92a2 commit ea3d69e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion include/version.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#define LAYER_ALCHEMY_VERSION_MAJOR 0
#define LAYER_ALCHEMY_VERSION_MINOR 9
#define LAYER_ALCHEMY_VERSION_PATCH 0
#define LAYER_ALCHEMY_VERSION_PATCH 1

#include <string>

Expand Down
11 changes: 5 additions & 6 deletions src/nuke/GradeBeauty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,9 +285,9 @@ void GradeBeauty::_validate(bool for_real)
setKnobDefaultValue(this);
_validate(true); // this will refresh the node UI in case the node was blank
}

calculateLayerValues(m_lsKnobData.m_selectedChannels, m_valueMap);
set_out_channels(activeChannelSet());
ChannelSet activeChannels = activeChannelSet();
calculateLayerValues(activeChannels - m_targetLayer, m_valueMap);
set_out_channels(activeChannels);
info_.turn_on(m_targetLayer);
}

Expand Down Expand Up @@ -383,14 +383,13 @@ void GradeBeauty::beautyPixelEngine(const Row& in, int y, int x, int r, ChannelS

void GradeBeauty::pixel_engine(const Row& in, int y, int x, int r, ChannelMask channels, Row& out)
{

ChannelSet inChannels = ChannelSet(channels);
ChannelSet activeChannels = activeChannelSet();
Row aRow(x, r);
bool isTargetLayer = m_targetLayer.intersection(inChannels).size() == m_targetLayer.size();
if (isTargetLayer)
{
channelPixelEngine(in, y, x, r, m_lsKnobData.m_selectedChannels, aRow);
ChannelSet activeChannels = activeChannelSet();
channelPixelEngine(in, y, x, r, activeChannels - m_targetLayer, aRow);
beautyPixelEngine(in, y, x, r, activeChannels, aRow);
}
else
Expand Down

0 comments on commit ea3d69e

Please sign in to comment.