diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs index 1153dca985..cb082f6ccb 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/JpegComponentPostProcessor8.cs @@ -43,10 +43,12 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder this.frame = frame; - this.dcDequantizer = this.rawJpeg.QuantizationTables[this.component.QuantizationTableIndex][0]; - this.component = component; + this.rawJpeg = rawJpeg; + + this.dcDequantizer = rawJpeg.QuantizationTables[this.component.QuantizationTableIndex][0]; + this.blockAreaSize = this.component.SubSamplingDivisors * blockSize; this.ColorBuffer = memoryAllocator.Allocate2DOveraligned( postProcessorBufferSize.Width, diff --git a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs index 5089449ef1..ed191bc063 100644 --- a/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs +++ b/src/ImageSharp/Formats/Jpeg/Components/Decoder/SpectralConversion/ResizingSpectralConverter{TPixel}.cs @@ -195,6 +195,9 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder cpp.Dispose(); } } + + this.rgbBuffer?.Dispose(); + this.paddedProxyPixelRow?.Dispose(); } // TODO: docs, code formatting