From 1ad9fcdad63259ee628b04c81b85108e9948bbfb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 6 Nov 2020 19:49:52 +0000 Subject: [PATCH] Handle Bmp encoder padding. --- src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs | 4 ++-- tests/ImageSharp.Tests/Common/SimdUtilsTests.cs | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs b/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs index 8fd6bcce6..07744566a 100644 --- a/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs +++ b/src/ImageSharp/Common/Helpers/SimdUtils.Shuffle.cs @@ -225,9 +225,9 @@ namespace SixLabors.ImageSharp "Output span must be divisable by 3!"); DebugGuard.IsTrue( - source.Length == dest.Length * 4 / 3, + dest.Length >= source.Length * 3 / 4, nameof(source), - "Output span must be 3/4 the length of the input span!"); + "Output span must be at least 3/4 the length of the input span!"); } public static class Shuffle diff --git a/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs b/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs index fe432107a..ec09e43e5 100644 --- a/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs +++ b/tests/ImageSharp.Tests/Common/SimdUtilsTests.cs @@ -164,8 +164,6 @@ namespace SixLabors.ImageSharp.Tests.Common public static readonly TheoryData ArraySizesDivisibleBy8 = new TheoryData { 0, 8, 16, 1024 }; public static readonly TheoryData ArraySizesDivisibleBy4 = new TheoryData { 0, 4, 8, 28, 1020 }; public static readonly TheoryData ArraySizesDivisibleBy3 = new TheoryData { 0, 3, 9, 36, 957 }; - - public static readonly TheoryData ArraySizesDivisibleBy32 = new TheoryData { 0, 32, 512 }; public static readonly TheoryData ArbitraryArraySizes =