From 3ad974a1d710af68796e3a4e2673d13fd609b91a Mon Sep 17 00:00:00 2001 From: John Haddon Date: Mon, 22 Jan 2024 22:17:57 +0000 Subject: [PATCH] FlatImageProcessor : Don't access input with invalid `image:viewName` We were already performing this check for array inputs, but had omitted it for the single-input case. --- Changes.md | 5 +++++ src/GafferImage/FlatImageProcessor.cpp | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Changes.md b/Changes.md index 0231fd3e253..35e500b82b1 100644 --- a/Changes.md +++ b/Changes.md @@ -1,6 +1,11 @@ 1.4.x.x (relative to 1.4.0.0b1) ======= +Fixes +----- + +- FlatImageProcessor : Fixed bug that could cause an input to be evaluated with an invalid `image:viewName`. + Breaking Changes ---------------- diff --git a/src/GafferImage/FlatImageProcessor.cpp b/src/GafferImage/FlatImageProcessor.cpp index edee9835fbd..f9de5d17f40 100644 --- a/src/GafferImage/FlatImageProcessor.cpp +++ b/src/GafferImage/FlatImageProcessor.cpp @@ -106,7 +106,10 @@ void FlatImageProcessor::hashDeep( const GafferImage::ImagePlug *parent, const G { // We need to append to the node hash, rather than just overriding with the upstream value, // so that we can't reuse the plug value from upstream, and have to call compute() - h.append( inPlug()->deepPlug()->hash() ); + if( ImageAlgo::viewIsValid( context, inPlug()->viewNames()->readable() ) ) + { + h.append( inPlug()->deepPlug()->hash() ); + } } } @@ -128,7 +131,10 @@ bool FlatImageProcessor::computeDeep( const Gaffer::Context *context, const Imag } else { - if( inPlug()->deepPlug()->getValue() ) + if( + ImageAlgo::viewIsValid( context, inPlug()->viewNames()->readable() ) && + inPlug()->deepPlug()->getValue() + ) { badInput = inPlug(); }