From 37e318de6d5c92f3ddf806dc6d869e0e6e2179cb Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 26 Jan 2020 21:38:59 +0100 Subject: [PATCH] Fixed a rollback error --- .../Processors/Effects/OilPaintingProcessor{TPixel}.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs index 1b350ea8b0..d8e2eec166 100644 --- a/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs +++ b/src/ImageSharp/Processing/Processors/Effects/OilPaintingProcessor{TPixel}.cs @@ -68,6 +68,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects { // Rent the shared buffer only once per parallel item. using IMemoryOwner bins = configuration.MemoryAllocator.Allocate(levels * 4); + ref float binsRef = ref bins.GetReference(); ref int intensityBinRef = ref Unsafe.As(ref binsRef); ref float redBinRef = ref Unsafe.Add(ref binsRef, levels); @@ -128,7 +129,7 @@ namespace SixLabors.ImageSharp.Processing.Processors.Effects float alpha = sourceRow[x].ToVector4().W; ref TPixel pixel = ref targetRow[x]; - pixel.FromVector4(new Vector4(red, green, blue, sourceRow[x].ToVector4().W)); + pixel.FromVector4(new Vector4(red, green, blue, alpha)); } } }