Skip to content

Commit d1cc651

Browse files
committed
fix BmpDecoder_ThrowsException_Issue2696
1 parent da49788 commit d1cc651

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -563,8 +563,11 @@ public void BmpDecoder_CanDecode_Os2BitmapArray<TPixel>(TestImageProvider<TPixel
563563
[WithFile(Issue2696, PixelTypes.Rgba32)]
564564
public void BmpDecoder_ThrowsException_Issue2696<TPixel>(TestImageProvider<TPixel> provider)
565565
where TPixel : unmanaged, IPixel<TPixel>
566-
=> Assert.Throws<InvalidImageContentException>(() =>
567-
{
568-
using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
569-
});
566+
{
567+
InvalidImageContentException ex = Assert.Throws<InvalidImageContentException>(() =>
568+
{
569+
using Image<TPixel> image = provider.GetImage(BmpDecoder.Instance);
570+
});
571+
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException);
572+
}
570573
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:de7e7ec0454a55f6a76c859f356b240a3d4cb56ca50dfa209a1813dd09e12076
3-
size 143
2+
oid sha256:bc42cda9bac8fc73351ad03bf55214069bb8d31ea5bdd806321a8cc8b56c282e
3+
size 126

0 commit comments

Comments
 (0)