From 64a9d25e963bfdefe5935093069bf3f9bc1a0685 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Sat, 30 Oct 2021 21:08:32 +0200 Subject: [PATCH] update webp code --- src/ImageSharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs | 2 +- src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ImageSharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs b/src/ImageSharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs index 768365e44e..3e06a56423 100644 --- a/src/ImageSharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs +++ b/src/ImageSharp/Formats/Webp/Lossless/WebpLosslessDecoder.cs @@ -197,7 +197,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossless for (int y = 0; y < height; y++) { Span rowAsBytes = pixelDataAsBytes.Slice(y * bytesPerRow, bytesPerRow); - Span pixelRow = pixels.GetRowSpan(y); + Span pixelRow = pixels.DangerousGetRowSpan(y); PixelOperations.Instance.FromBgra32Bytes( this.configuration, rowAsBytes.Slice(0, bytesPerRow), diff --git a/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs b/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs index ebb0b0aa4a..d6f5f7103e 100644 --- a/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs +++ b/src/ImageSharp/Formats/Webp/Lossy/WebpLossyDecoder.cs @@ -118,7 +118,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy for (int y = 0; y < height; y++) { Span row = pixelData.Slice(y * widthMul3, widthMul3); - Span decodedPixelRow = decodedPixels.GetRowSpan(y); + Span decodedPixelRow = decodedPixels.DangerousGetRowSpan(y); PixelOperations.Instance.FromBgr24Bytes( this.configuration, row, @@ -136,7 +136,7 @@ namespace SixLabors.ImageSharp.Formats.Webp.Lossy for (int y = 0; y < height; y++) { int yMulWidth = y * width; - Span decodedPixelRow = decodedPixels.GetRowSpan(y); + Span decodedPixelRow = decodedPixels.DangerousGetRowSpan(y); for (int x = 0; x < width; x++) { int offset = yMulWidth + x;