diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs index 6424ee23ac..0ff10e2700 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/HuffmanScanDecoder.cs @@ -29,16 +29,16 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder private readonly int componentsLength; // The spectral selection start. - private readonly int spectralStart; + public int spectralStart; // The spectral selection end. - private readonly int spectralEnd; + public int spectralEnd; // The successive approximation high bit end. - private readonly int successiveHigh; + public int successiveHigh; // The successive approximation low bit end. - private readonly int successiveLow; + public int successiveLow; // How many mcu's are left to do. private int todo; @@ -74,10 +74,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder HuffmanTable[] acHuffmanTables, int componentsLength, int restartInterval, - int spectralStart, - int spectralEnd, - int successiveHigh, - int successiveLow, CancellationToken cancellationToken) { this.dctZigZag = ZigZag.CreateUnzigTable(); @@ -90,10 +86,6 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder this.componentsLength = componentsLength; this.restartInterval = restartInterval; this.todo = restartInterval; - this.spectralStart = spectralStart; - this.spectralEnd = spectralEnd; - this.successiveHigh = successiveHigh; - this.successiveLow = successiveLow; this.cancellationToken = cancellationToken; } diff --git a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs index ad47f386d2..b2eb18941b 100644 --- a/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs +++ b/src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs @@ -1056,11 +1056,13 @@ namespace SixLabors.ImageSharp.Formats.Jpeg this.acHuffmanTables, selectorsCount, this.resetInterval, - spectralStart, - spectralEnd, - successiveApproximation >> 4, - successiveApproximation & 15, - cancellationToken); + cancellationToken) + { + spectralStart = spectralStart, + spectralEnd = spectralEnd, + successiveHigh = successiveApproximation >> 4, + successiveLow = successiveApproximation & 15 + }; sd.ParseEntropyCodedData(); }