Skip to content

Commit f45e184

Browse files
committed
Add test for issue #1891
1 parent ae84ff6 commit f45e184

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,18 @@ public void TiffDecoder_CanDecode_PackBitsCompressed<TPixel>(TestImageProvider<T
380380
public void TiffDecoder_CanDecode_JpegCompressed<TPixel>(TestImageProvider<TPixel> provider)
381381
where TPixel : unmanaged, IPixel<TPixel> => TestTiffDecoder(provider, useExactComparer: false);
382382

383+
// https://github.com/SixLabors/ImageSharp/issues/1891
384+
[Theory]
385+
[WithFile(Issues1891, PixelTypes.Rgba32)]
386+
public void TiffDecoder_ThrowsException_WithTooManyDirectories<TPixel>(TestImageProvider<TPixel> provider)
387+
where TPixel : unmanaged, IPixel<TPixel> => Assert.Throws<ImageFormatException>(
388+
() =>
389+
{
390+
using (provider.GetImage(TiffDecoder))
391+
{
392+
}
393+
});
394+
383395
[Theory]
384396
[WithFileCollection(nameof(MultiframeTestImages), PixelTypes.Rgba32)]
385397
public void DecodeMultiframe<TPixel>(TestImageProvider<TPixel> provider)

tests/ImageSharp.Tests/TestImages.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ public static class Tiff
840840
public const string Flower32BitGrayPredictorLittleEndian = "Tiff/flower-minisblack-32_lsb_deflate_predictor.tiff";
841841

842842
public const string Issues1716Rgb161616BitLittleEndian = "Tiff/Issues/Issue1716.tiff";
843+
public const string Issues1891 = "Tiff/Issues/Issue1891.tiff";
843844

844845
public const string SmallRgbDeflate = "Tiff/rgb_small_deflate.tiff";
845846
public const string SmallRgbLzw = "Tiff/rgb_small_lzw.tiff";
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version https://git-lfs.github.com/spec/v1
2+
oid sha256:a2779c7fb2c2ad858e0d7efcfffd594cc6fb2846e0475a2998a3cda50f289b9b
3+
size 307

0 commit comments

Comments
 (0)