From 497939a69ada69bedca18fc37e0e02c3071c7b7e Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Mon, 14 Nov 2016 18:08:05 +0100 Subject: [PATCH] Fixed SA1127 --- src/ImageSharp/Formats/Png/PngDecoderCore.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/ImageSharp/Formats/Png/PngDecoderCore.cs b/src/ImageSharp/Formats/Png/PngDecoderCore.cs index a5fd051b3..f31af2b49 100644 --- a/src/ImageSharp/Formats/Png/PngDecoderCore.cs +++ b/src/ImageSharp/Formats/Png/PngDecoderCore.cs @@ -114,7 +114,8 @@ namespace ImageSharp.Formats /// Thrown if the image is larger than the maximum allowable size. /// public void Decode(Image image, Stream stream) - where TColor : struct, IPackedPixel where TPacked : struct + where TColor : struct, IPackedPixel + where TPacked : struct { Image currentImage = image; this.currentStream = stream; @@ -194,7 +195,8 @@ namespace ImageSharp.Formats /// The image to read to. /// The data containing physical data. private void ReadPhysicalChunk(Image image, byte[] data) - where TColor : struct, IPackedPixel where TPacked : struct + where TColor : struct, IPackedPixel + where TPacked : struct { data.ReverseBytes(0, 4); data.ReverseBytes(4, 4); @@ -255,7 +257,8 @@ namespace ImageSharp.Formats /// The containing data. /// The pixel data. private void ReadScanlines(MemoryStream dataStream, PixelAccessor pixels) - where TColor : struct, IPackedPixel where TPacked : struct + where TColor : struct, IPackedPixel + where TPacked : struct { this.bytesPerPixel = this.CalculateBytesPerPixel(); this.bytesPerScanline = this.CalculateScanlineLength() + 1; @@ -280,7 +283,8 @@ namespace ImageSharp.Formats /// The compressed pixel data stream. /// The image pixel accessor. private void DecodePixelData(Stream compressedStream, PixelAccessor pixels) - where TColor : struct, IPackedPixel where TPacked : struct + where TColor : struct, IPackedPixel + where TPacked : struct { byte[] previousScanline = ArrayPool.Shared.Rent(this.bytesPerScanline); byte[] scanline = ArrayPool.Shared.Rent(this.bytesPerScanline);