From 1acbfbe3e511a9bfe4507d0bdc1ea183fa053d15 Mon Sep 17 00:00:00 2001 From: Brian Popow Date: Thu, 8 Sep 2022 12:18:39 +0200 Subject: [PATCH] Remove VerifyDimensions, does not make sense anymore --- src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs | 2 -- src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs | 18 ------------------ 2 files changed, 20 deletions(-) diff --git a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs index 350823dec..298982f8d 100644 --- a/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs +++ b/src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs @@ -1471,8 +1471,6 @@ namespace SixLabors.ImageSharp.Formats.Bmp } } - this.infoHeader.VerifyDimensions(); - int skipAmount = this.fileHeader.Offset - (int)this.stream.Position; if ((skipAmount + (int)this.stream.Position) > this.stream.Length) { diff --git a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs index ca52e4db1..15b0297de 100644 --- a/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs +++ b/src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs @@ -552,23 +552,5 @@ namespace SixLabors.ImageSharp.Formats.Bmp dest = this; } - - internal void VerifyDimensions() - { - if (this.Width > MaximumBmpDimension || this.Height > MaximumBmpDimension) - { - throw new InvalidOperationException( - $"The input bmp '{this.Width}x{this.Height}' has a width or height " - + $"bigger then the max allowed '{MaximumBmpDimension}'"); - } - - long size = this.Width * this.Height; - if (size > MaximumBmpSize) - { - throw new InvalidOperationException( - $"The input bmp '{this.Width}x{this.Height}' has a size {size}" - + $"bigger then the max allowed '{MaximumBmpSize}'"); - } - } } }