From c09fc39f089cb2933c452f014c370693e39f0444 Mon Sep 17 00:00:00 2001 From: Frederic Devernay Date: Tue, 28 Sep 2021 18:22:56 -0700 Subject: [PATCH] better code safety avoid UMR and division by zero --- Add/Add.cpp | 4 ++-- Clamp/Clamp.cpp | 4 ++-- ClipTest/ClipTest.cpp | 4 ++-- ColorCorrect/ColorCorrect.cpp | 4 ++-- ColorLookup/ColorLookup.cpp | 6 +++--- ColorMatrix/ColorMatrix.cpp | 4 ++-- ColorSuppress/ColorSuppress.cpp | 4 ++-- ColorTransform/ColorTransform.cpp | 4 ++-- ColorWheel/ColorWheel.cpp | 3 +++ DenoiseSharpen/DenoiseSharpen.cpp | 4 ++-- Despill/Despill.cpp | 2 +- Distortion/Distortion.cpp | 2 +- Gamma/Gamma.cpp | 4 ++-- Grade/Grade.cpp | 4 ++-- HSVTool/HSVTool.cpp | 4 ++-- HueCorrect/HueCorrect.cpp | 4 ++-- HueCorrect/HueCorrect1.cpp | 4 ++-- Invert/Invert.cpp | 4 ++-- KeyMix/KeyMix.cpp | 2 +- Log2Lin/Log2Lin.cpp | 8 ++++---- Multiply/Multiply.cpp | 4 ++-- PLogLin/PLogLin.cpp | 8 ++++---- Quantize/Quantize.cpp | 4 ++-- Radial/Radial.cpp | 5 ++++- Ramp/Ramp.cpp | 2 +- Rectangle/Rectangle.cpp | 7 +++++-- Saturation/Saturation.cpp | 4 ++-- SupportExt | 2 +- Templates/MaskableFilter.cpp | 4 ++-- Templates/MixableFilter.cpp | 4 ++-- Templates/SimpleFilter.cpp | 4 ++-- 31 files changed, 68 insertions(+), 59 deletions(-) diff --git a/Add/Add.cpp b/Add/Add.cpp index e7093e8e..83bfd3ac 100644 --- a/Add/Add.cpp +++ b/Add/Add.cpp @@ -307,8 +307,8 @@ class AddProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Clamp/Clamp.cpp b/Clamp/Clamp.cpp index 5ff6757d..2b07f122 100644 --- a/Clamp/Clamp.cpp +++ b/Clamp/Clamp.cpp @@ -361,8 +361,8 @@ class ImageClamper void processClampTo(const OfxRectI& procWindow, const OfxPointD& rs) { unused(rs); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { diff --git a/ClipTest/ClipTest.cpp b/ClipTest/ClipTest.cpp index 4ecb1979..f6eb8d07 100644 --- a/ClipTest/ClipTest.cpp +++ b/ClipTest/ClipTest.cpp @@ -262,8 +262,8 @@ class ClipTestProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/ColorCorrect/ColorCorrect.cpp b/ColorCorrect/ColorCorrect.cpp index 26786349..a2ac348d 100644 --- a/ColorCorrect/ColorCorrect.cpp +++ b/ColorCorrect/ColorCorrect.cpp @@ -632,8 +632,8 @@ class ColorCorrecter assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/ColorLookup/ColorLookup.cpp b/ColorLookup/ColorLookup.cpp index 11fa0058..6b1b5b46 100644 --- a/ColorLookup/ColorLookup.cpp +++ b/ColorLookup/ColorLookup.cpp @@ -436,7 +436,7 @@ class ColorLookupProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; @@ -542,7 +542,7 @@ class ColorLookupProcessor ofxsMaskMixPix(tmpPix, x, y, srcPix, _doMasking, _maskImg, (float)_mix, _maskInvert, dstPix); } else { //assert(nComponents == 4); - float unpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(srcPix, unpPix, _premult, _premultChannel); float r = unpPix[0]; float g = unpPix[1]; @@ -870,7 +870,7 @@ class HistogramProcessor PIX *dstPix = (PIX *) _dstImg->getPixelAddress(procWindow.x1, y); for (int x = procWindow.x1; x < procWindow.x2; ++x) { - float unpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(dstPix, unpPix, _premult, _premultChannel); for (int c = 0; c < (std::min)(nComponents, 3); ++c) { diff --git a/ColorMatrix/ColorMatrix.cpp b/ColorMatrix/ColorMatrix.cpp index 6d3ef4ad..f73237d4 100644 --- a/ColorMatrix/ColorMatrix.cpp +++ b/ColorMatrix/ColorMatrix.cpp @@ -305,8 +305,8 @@ class ColorMatrixProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/ColorSuppress/ColorSuppress.cpp b/ColorSuppress/ColorSuppress.cpp index b8259b97..80d6a5d0 100644 --- a/ColorSuppress/ColorSuppress.cpp +++ b/ColorSuppress/ColorSuppress.cpp @@ -276,8 +276,8 @@ class ColorSuppressProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/ColorTransform/ColorTransform.cpp b/ColorTransform/ColorTransform.cpp index fe3c5fb4..f17e6c01 100644 --- a/ColorTransform/ColorTransform.cpp +++ b/ColorTransform/ColorTransform.cpp @@ -261,8 +261,8 @@ class ColorTransformProcessor unused(rs); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; const bool dounpremult = _premult && fromRGB(transform); const bool dopremult = _premult && toRGB(transform); diff --git a/ColorWheel/ColorWheel.cpp b/ColorWheel/ColorWheel.cpp index 0a392ec8..fb89b3c5 100644 --- a/ColorWheel/ColorWheel.cpp +++ b/ColorWheel/ColorWheel.cpp @@ -219,6 +219,9 @@ class ColorWheelProcessor { double par = _dstImg->getPixelAspectRatio(); OfxPointD c; // center position in pixel + if (par <= 0.) { + par = 1.; + } Coords::toPixelSub(_center, rs, par, &c); OfxPointD r; // radius in pixel diff --git a/DenoiseSharpen/DenoiseSharpen.cpp b/DenoiseSharpen/DenoiseSharpen.cpp index f9debe6f..7a103c74 100644 --- a/DenoiseSharpen/DenoiseSharpen.cpp +++ b/DenoiseSharpen/DenoiseSharpen.cpp @@ -2545,7 +2545,7 @@ DenoiseSharpenPlugin::renderForBitDepth(const RenderArguments &args) for (int x = p.srcWindow.x1; x < p.srcWindow.x2; x++) { const PIX *srcPix = (const PIX *) (src.get() ? src->getPixelAddress(x, y) : 0); - float unpPix[4] = {0., 0., 0., 0.}; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(srcPix, unpPix, p.premult, p.premultChannel); unsigned int pix = (x - p.srcWindow.x1) + (y - p.srcWindow.y1) * iwidth; // convert to the appropriate color model and store in tmpPixelData @@ -3159,7 +3159,7 @@ DenoiseSharpenPlugin::analyzeNoiseLevelsForBitDepth(const InstanceChangedArgs &a for (int x = srcWindow.x1; x < srcWindow.x2; x++) { const PIX *srcPix = (const PIX *) (src.get() ? src->getPixelAddress(x, y) : 0); - float unpPix[4] = {0., 0., 0., 0.}; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(srcPix, unpPix, premult, premultChannel); unsigned int pix = (x - srcWindow.x1) + (y - srcWindow.y1) * iwidth; // convert to the appropriate color model and store in tmpPixelData diff --git a/Despill/Despill.cpp b/Despill/Despill.cpp index 57e03f18..3c7d0a31 100644 --- a/Despill/Despill.cpp +++ b/Despill/Despill.cpp @@ -266,7 +266,7 @@ class DespillProcessor void multiThreadProcessImages(const OfxRectI& procWindow, const OfxPointD& rs) OVERRIDE FINAL { unused(rs); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; assert(nComponents == 3 || nComponents == 4); assert(_dstImg); diff --git a/Distortion/Distortion.cpp b/Distortion/Distortion.cpp index 425d1aca..647b3501 100644 --- a/Distortion/Distortion.cpp +++ b/Distortion/Distortion.cpp @@ -956,7 +956,7 @@ DistortionProcessor::multiThr int srcy1 = int(std::ceil(_format.y1)); int srcy2 = int(std::floor(_format.y2)); //} - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Gamma/Gamma.cpp b/Gamma/Gamma.cpp index 9a882042..13f9bd56 100644 --- a/Gamma/Gamma.cpp +++ b/Gamma/Gamma.cpp @@ -264,8 +264,8 @@ class GammaProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Grade/Grade.cpp b/Grade/Grade.cpp index c6f5e6d2..c2a5a6fc 100644 --- a/Grade/Grade.cpp +++ b/Grade/Grade.cpp @@ -691,8 +691,8 @@ class GradeProcessor assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; if ( reverse() ) { for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { diff --git a/HSVTool/HSVTool.cpp b/HSVTool/HSVTool.cpp index d6384cfb..4d23f89d 100644 --- a/HSVTool/HSVTool.cpp +++ b/HSVTool/HSVTool.cpp @@ -629,8 +629,8 @@ class HSVToolProcessor unused(rs); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; // only premultiply output if keeping the source alpha const bool premultOut = _premult && (_outputAlpha == eOutputAlphaSource); for (int y = procWindow.y1; y < procWindow.y2; y++) { diff --git a/HueCorrect/HueCorrect.cpp b/HueCorrect/HueCorrect.cpp index 63a8fb0f..34032cfb 100644 --- a/HueCorrect/HueCorrect.cpp +++ b/HueCorrect/HueCorrect.cpp @@ -326,7 +326,7 @@ class HueCorrectProcessor unused(rs); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; @@ -336,7 +336,7 @@ class HueCorrectProcessor for (int x = procWindow.x1; x < procWindow.x2; x++) { const PIX *srcPix = (const PIX *) (_srcImg ? _srcImg->getPixelAddress(x, y) : 0); - float unpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(srcPix, unpPix, _premult, _premultChannel); // ofxsUnPremult outputs normalized data diff --git a/HueCorrect/HueCorrect1.cpp b/HueCorrect/HueCorrect1.cpp index c1c90ffc..1b4e2174 100644 --- a/HueCorrect/HueCorrect1.cpp +++ b/HueCorrect/HueCorrect1.cpp @@ -320,7 +320,7 @@ class HueCorrectProcessor unused(rs); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; @@ -330,7 +330,7 @@ class HueCorrectProcessor for (int x = procWindow.x1; x < procWindow.x2; x++) { const PIX *srcPix = (const PIX *) (_srcImg ? _srcImg->getPixelAddress(x, y) : 0); - float unpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; ofxsUnPremult(srcPix, unpPix, _premult, _premultChannel); // ofxsUnPremult outputs normalized data diff --git a/Invert/Invert.cpp b/Invert/Invert.cpp index 931e4025..b39a08e1 100644 --- a/Invert/Invert.cpp +++ b/Invert/Invert.cpp @@ -240,8 +240,8 @@ class ImageInverter void process(const OfxRectI& procWindow, const OfxPointD& rs) { unused(rs); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { diff --git a/KeyMix/KeyMix.cpp b/KeyMix/KeyMix.cpp index 3564df27..aaa1b09b 100644 --- a/KeyMix/KeyMix.cpp +++ b/KeyMix/KeyMix.cpp @@ -170,7 +170,7 @@ class KeyMixProcessor void multiThreadProcessImages(const OfxRectI& procWindow, const OfxPointD& rs) OVERRIDE FINAL { unused(rs); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int c = 0; c < 4; ++c) { tmpPix[c] = 0; } diff --git a/Log2Lin/Log2Lin.cpp b/Log2Lin/Log2Lin.cpp index 0e76dd85..235c73ff 100644 --- a/Log2Lin/Log2Lin.cpp +++ b/Log2Lin/Log2Lin.cpp @@ -299,8 +299,8 @@ class PLog2LinProcessor unused(rs); assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; @@ -403,8 +403,8 @@ class PLin2LogProcessor unused(rs); assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Multiply/Multiply.cpp b/Multiply/Multiply.cpp index 0270b573..38a2f3ce 100644 --- a/Multiply/Multiply.cpp +++ b/Multiply/Multiply.cpp @@ -262,8 +262,8 @@ class MultiplyProcessor unused(rs); assert(nComponents == 1 || nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/PLogLin/PLogLin.cpp b/PLogLin/PLogLin.cpp index 698cea68..82ce6260 100644 --- a/PLogLin/PLogLin.cpp +++ b/PLogLin/PLogLin.cpp @@ -309,8 +309,8 @@ class PLog2LinProcessor unused(rs); assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; @@ -407,8 +407,8 @@ class PLin2LogProcessor unused(rs); assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Quantize/Quantize.cpp b/Quantize/Quantize.cpp index 57d1d7d9..92195e1b 100644 --- a/Quantize/Quantize.cpp +++ b/Quantize/Quantize.cpp @@ -382,8 +382,8 @@ class QuantizeProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; // set up a random number generator and set the seed #ifdef USE_RANDOMGENERATOR RandomGenerator randy; diff --git a/Radial/Radial.cpp b/Radial/Radial.cpp index b0be5323..f967838b 100644 --- a/Radial/Radial.cpp +++ b/Radial/Radial.cpp @@ -336,8 +336,11 @@ class RadialProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; double par = _dstImg->getPixelAspectRatio(); + if (par <= 0.) { + par = 1.; + } // center of the ellipse OfxPointD c_canonical = { ( _btmLeft.x + (_btmLeft.x + _size.x) ) / 2, ( _btmLeft.y + (_btmLeft.y + _size.y) ) / 2 }; diff --git a/Ramp/Ramp.cpp b/Ramp/Ramp.cpp index eb0e86e1..81bcb322 100644 --- a/Ramp/Ramp.cpp +++ b/Ramp/Ramp.cpp @@ -311,7 +311,7 @@ class RampProcessor template void processForType(const OfxRectI& procWindow, const OfxPointD& rs) { - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; const double norm2 = (_point1.x - _point0.x) * (_point1.x - _point0.x) + (_point1.y - _point0.y) * (_point1.y - _point0.y); const double nx = norm2 == 0. ? 0. : (_point1.x - _point0.x) / norm2; const double ny = norm2 == 0. ? 0. : (_point1.y - _point0.y) / norm2; diff --git a/Rectangle/Rectangle.cpp b/Rectangle/Rectangle.cpp index 7762d6b2..f079da39 100644 --- a/Rectangle/Rectangle.cpp +++ b/Rectangle/Rectangle.cpp @@ -349,8 +349,11 @@ class RectangleProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); - float tmpPix[4]; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; double par = _dstImg->getPixelAspectRatio(); + if (par <= 0.) { + par = 1.; + } OfxPointD btmLeft_canonical = { _btmLeft.x, _btmLeft.y }; OfxPointD topRight_canonical = { _btmLeft.x + _size.x, _btmLeft.y + _size.y }; OfxPointD btmLeft; // btmLeft position in pixel @@ -449,7 +452,7 @@ class RectangleProcessor tmpPix[3] = (float)_color0.a; } else { // always consider the value closest top the center to avoid discontinuities/artifacts - if (_softness == 0) { + if (_softness <= 0) { // solid color tmpPix[0] = (float)_color1.r; tmpPix[1] = (float)_color1.g; diff --git a/Saturation/Saturation.cpp b/Saturation/Saturation.cpp index edcf07b3..54b4f8e8 100644 --- a/Saturation/Saturation.cpp +++ b/Saturation/Saturation.cpp @@ -375,8 +375,8 @@ class SaturationProcessor assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); assert(_dstImg); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/SupportExt b/SupportExt index 194f48cf..eaf9f886 160000 --- a/SupportExt +++ b/SupportExt @@ -1 +1 @@ -Subproject commit 194f48cff78ed90ed8eabb618bfb93cdd9f7188d +Subproject commit eaf9f88610ffa3777e5791462b1d73efd62e6769 diff --git a/Templates/MaskableFilter.cpp b/Templates/MaskableFilter.cpp index 899dda94..3da9b40d 100644 --- a/Templates/MaskableFilter.cpp +++ b/Templates/MaskableFilter.cpp @@ -246,8 +246,8 @@ class MaskableFilterProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Templates/MixableFilter.cpp b/Templates/MixableFilter.cpp index e880a883..b7e731e3 100644 --- a/Templates/MixableFilter.cpp +++ b/Templates/MixableFilter.cpp @@ -235,8 +235,8 @@ class MixableFilterProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break; diff --git a/Templates/SimpleFilter.cpp b/Templates/SimpleFilter.cpp index 7239e444..f025b7a6 100644 --- a/Templates/SimpleFilter.cpp +++ b/Templates/SimpleFilter.cpp @@ -231,8 +231,8 @@ class SimpleFilterProcessor assert( (!processR && !processG && !processB) || (nComponents == 3 || nComponents == 4) ); assert( !processA || (nComponents == 1 || nComponents == 4) ); assert(nComponents == 3 || nComponents == 4); - float unpPix[4]; - float tmpPix[4]; + float unpPix[4] = {0.f, 0.f, 0.f, 0.f}; + float tmpPix[4] = {0.f, 0.f, 0.f, 0.f}; for (int y = procWindow.y1; y < procWindow.y2; y++) { if ( _effect.abort() ) { break;