mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:27:35 +00:00
LibGfx: Make NamedColor2TagData verify inputs are 32-byte 7-bit ASCII
NamedColor2TagData::from_bytes() errors out if that isn't the case, but let's make sure other potential future callers get it right too.
This commit is contained in:
parent
7ad11fa59a
commit
eac9941766
1 changed files with 14 additions and 0 deletions
|
@ -537,6 +537,20 @@ public:
|
|||
{
|
||||
VERIFY(root_names.size() == pcs_coordinates.size());
|
||||
VERIFY(root_names.size() * number_of_device_coordinates == device_coordinates.size());
|
||||
|
||||
for (u8 byte : m_prefix.bytes())
|
||||
VERIFY(byte < 128);
|
||||
VERIFY(m_prefix.bytes().size() < 32);
|
||||
|
||||
for (u8 byte : m_suffix.bytes())
|
||||
VERIFY(byte < 128);
|
||||
VERIFY(m_suffix.bytes().size() < 32);
|
||||
|
||||
for (auto const& root_name : m_root_names) {
|
||||
for (u8 byte : root_name.bytes())
|
||||
VERIFY(byte < 128);
|
||||
VERIFY(root_name.bytes().size() < 32);
|
||||
}
|
||||
}
|
||||
|
||||
// "(least-significant 16 bits reserved for ICC use)"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue