From 6fdf643d55c4140580c9a6810d77ff2f096868d8 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Sat, 15 Jan 2022 16:24:15 +0100 Subject: [PATCH] Fix build errors --- src/ImageSharp/Formats/Webp/AlphaDecoder.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ImageSharp/Formats/Webp/AlphaDecoder.cs b/src/ImageSharp/Formats/Webp/AlphaDecoder.cs index 24104369ee..b1e155c1d6 100644 --- a/src/ImageSharp/Formats/Webp/AlphaDecoder.cs +++ b/src/ImageSharp/Formats/Webp/AlphaDecoder.cs @@ -321,7 +321,7 @@ namespace SixLabors.ImageSharp.Formats.Webp } nint i; - var last = Vector128.Zero.WithElement(0, dst[0]); + Vector128 last = Vector128.Zero.WithElement(0, dst[0]); ref byte srcRef = ref MemoryMarshal.GetReference(input); for (i = 1; i + 8 <= width; i += 8) { @@ -341,7 +341,7 @@ namespace SixLabors.ImageSharp.Formats.Webp for (; i < width; ++i) { - dst[i] = (byte)(input[i] + dst[i - 1]); + dst[(int)i] = (byte)(input[(int)i] + dst[(int)i - 1]); } } else @@ -360,7 +360,7 @@ namespace SixLabors.ImageSharp.Formats.Webp private static void VerticalUnfilter(Span prev, Span input, Span dst, int width) { - if (prev == null) + if (prev.IsEmpty) { HorizontalUnfilter(null, input, dst, width); } @@ -382,7 +382,7 @@ namespace SixLabors.ImageSharp.Formats.Webp for (; i < width; i++) { - dst[i] = (byte)(prev[i] + input[i]); + dst[(int)i] = (byte)(prev[(int)i] + input[(int)i]); } } else @@ -398,7 +398,7 @@ namespace SixLabors.ImageSharp.Formats.Webp private static void GradientUnfilter(Span prev, Span input, Span dst, int width) { - if (prev == null) + if (prev.IsEmpty) { HorizontalUnfilter(null, input, dst, width); }