Browse Source

fix BmpDecoder_ThrowsException_Issue2696

pull/2706/head
antonfirsov 2 years ago
parent
commit
d1cc651e19
  1. 11
      tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
  2. 4
      tests/Images/Input/Bmp/issue-2696.bmp

11
tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs

@ -563,8 +563,11 @@ public class BmpDecoderTests
[WithFile(Issue2696, PixelTypes.Rgba32)]
public void BmpDecoder_ThrowsException_Issue2696<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
=> Assert.Throws<InvalidImageContentException>(() =>
{
using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
});
{
InvalidImageContentException ex = Assert.Throws<InvalidImageContentException>(() =>
{
using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
});
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException);
}
}

4
tests/Images/Input/Bmp/issue-2696.bmp

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:de7e7ec0454a55f6a76c859f356b240a3d4cb56ca50dfa209a1813dd09e12076
size 143
oid sha256:bc42cda9bac8fc73351ad03bf55214069bb8d31ea5bdd806321a8cc8b56c282e
size 126

Loading…
Cancel
Save