mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
LibGfx/TIFF: Reject images with an incoherent number of BitsPerSample
Fixes oss-fuzz issue 66588: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=66588
This commit is contained in:
parent
d15785cccc
commit
06665cba9c
Notes:
sideshowbarker
2024-07-18 22:57:59 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/06665cba9c Pull-request: https://github.com/SerenityOS/serenity/pull/23529
@ -106,6 +106,12 @@ public:
|
||||
if (any_of(*m_metadata.bits_per_sample(), [](auto bit_depth) { return bit_depth == 0 || bit_depth > 32; }))
|
||||
return Error::from_string_literal("TIFFImageDecoderPlugin: Invalid value in BitsPerSample");
|
||||
|
||||
if (m_metadata.bits_per_sample()->size() != m_metadata.samples_per_pixel())
|
||||
return Error::from_string_literal("TIFFImageDecoderPlugin: Invalid number of values in BitsPerSample");
|
||||
|
||||
if (*m_metadata.samples_per_pixel() < samples_for_photometric_interpretation())
|
||||
return Error::from_string_literal("TIFFImageDecoderPlugin: Not enough values in BitsPerSample for given PhotometricInterpretation");
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user