Skip to content

Commit 3d298db

Browse files
committed
Adapt BmpDecoder_ThrowsException_Issue2696 for V2
1 parent 5c6ec5d commit 3d298db

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -624,9 +624,13 @@ public void BmpDecoder_CanDecode_Os2BitmapArray<TPixel>(TestImageProvider<TPixel
624624
[WithFile(Issue2696, PixelTypes.Rgba32)]
625625
public void BmpDecoder_ThrowsException_Issue2696<TPixel>(TestImageProvider<TPixel> provider)
626626
where TPixel : unmanaged, IPixel<TPixel>
627-
=> Assert.Throws<InvalidImageContentException>(() =>
628-
{
629-
using Image<TPixel> image = provider.GetImage(BmpDecoder);
630-
});
627+
{
628+
// On V2 this is throwing InvalidOperationException,
629+
// because of the validation logic in BmpInfoHeader.VerifyDimensions().
630+
Assert.Throws<InvalidOperationException>(() =>
631+
{
632+
using Image<TPixel> image = provider.GetImage(BmpDecoder);
633+
});
634+
}
631635
}
632636
}

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)