Browse Source

Throw exception for single channel tiff when bits per sample is larger then 16

pull/1652/head
Brian Popow 5 years ago
parent
commit
aba1050bae
  1. 10
      src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs

10
src/ImageSharp/Formats/Tiff/TiffDecoderOptionsParser.cs

@ -105,6 +105,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff
}
ushort bitsPerChannel = options.BitsPerSample[0];
if (bitsPerChannel > 16)
{
TiffThrowHelper.ThrowNotSupported("Bits per sample is not supported.");
}
switch (bitsPerChannel)
{
case 8:
@ -143,6 +148,11 @@ namespace SixLabors.ImageSharp.Formats.Tiff
}
ushort bitsPerChannel = options.BitsPerSample[0];
if (bitsPerChannel > 16)
{
TiffThrowHelper.ThrowNotSupported("Bits per sample is not supported.");
}
switch (bitsPerChannel)
{
case 8:

Loading…
Cancel
Save