Browse Source

Remove VerifyDimensions, does not make sense anymore

pull/2192/head
Brian Popow 3 years ago
parent
commit
1acbfbe3e5
  1. 2
      src/ImageSharp/Formats/Bmp/BmpDecoderCore.cs
  2. 18
      src/ImageSharp/Formats/Bmp/BmpInfoHeader.cs

2
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)
{

18
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}'");
}
}
}
}

Loading…
Cancel
Save