diff --git a/src/ImageSharp.Formats.Jpeg/Components/Decoder/DecodedBlock.cs b/src/ImageSharp.Formats.Jpeg/Components/Decoder/DecodedBlock.cs index bc93a18f7..900d77ec4 100644 --- a/src/ImageSharp.Formats.Jpeg/Components/Decoder/DecodedBlock.cs +++ b/src/ImageSharp.Formats.Jpeg/Components/Decoder/DecodedBlock.cs @@ -35,24 +35,16 @@ namespace ImageSharp.Formats.Jpg public Block8x8F Block; /// - /// Store the block data into a at the given index of an . + /// Store the block data into a /// - /// The array - /// The index in the array /// X coordinate of the block /// Y coordinate of the block /// The - public static void Store(ref DecodedBlockArray blockArray, int index, int bx, int by, ref Block8x8F block) + public void SaveBlock(int bx, int by, ref Block8x8F block) { - if (index >= blockArray.Count) - { - throw new IndexOutOfRangeException("Block index is out of range in DecodedBlock.Store()!"); - } - - blockArray.Buffer[index].Initialized = true; - blockArray.Buffer[index].Bx = bx; - blockArray.Buffer[index].By = by; - blockArray.Buffer[index].Block = block; + this.Bx = bx; + this.By = by; + this.Block = block; } } } \ No newline at end of file diff --git a/src/ImageSharp.Formats.Jpeg/Components/Decoder/JpegScanDecoder.cs b/src/ImageSharp.Formats.Jpeg/Components/Decoder/JpegScanDecoder.cs index a43c545cd..10f859e42 100644 --- a/src/ImageSharp.Formats.Jpeg/Components/Decoder/JpegScanDecoder.cs +++ b/src/ImageSharp.Formats.Jpeg/Components/Decoder/JpegScanDecoder.cs @@ -180,7 +180,7 @@ namespace ImageSharp.Formats.Jpg // Store the decoded block DecodedBlockArray blocks = decoder.DecodedBlocks[this.ComponentIndex]; - DecodedBlock.Store(ref blocks, blockIndex, this.bx, this.by, ref this.data.Block); + blocks.Buffer[blockIndex].SaveBlock(this.bx, this.by, ref this.data.Block); } // for j