From 586df2e7b136745736884072a49ec797715d5feb Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Tue, 23 Nov 2021 21:49:27 +0300 Subject: [PATCH] Fixed crash bug --- .../Formats/Jpeg/Components/FastFloatingPointDCT.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs b/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs index 770093195..81bfe2135 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/FastFloatingPointDCT.cs @@ -70,8 +70,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components ref float multipliersRef = ref MemoryMarshal.GetReference(AdjustmentCoefficients); for (nint i = 0; i < Block8x8F.Size; i++) { - tableRef = ref Unsafe.Add(ref tableRef, i); tableRef = 0.125f * tableRef * Unsafe.Add(ref multipliersRef, i); + tableRef = ref Unsafe.Add(ref tableRef, 1); } // Spectral macroblocks are transposed before quantization @@ -89,8 +89,8 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components ref float multipliersRef = ref MemoryMarshal.GetReference(AdjustmentCoefficients); for (nint i = 0; i < Block8x8F.Size; i++) { - tableRef = ref Unsafe.Add(ref tableRef, i); tableRef = 0.125f / (tableRef * Unsafe.Add(ref multipliersRef, i)); + tableRef = ref Unsafe.Add(ref tableRef, 1); } }