1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:07:34 +00:00

LibGfx/DDS: Don't double-check the magic number

This is already done in `decode_dds()`.
This commit is contained in:
Lucas CHOLLET 2023-07-06 23:03:47 -04:00 committed by Sam Atkins
parent c336cef065
commit 8946c0c104

View file

@ -634,15 +634,7 @@ IntSize DDSImageDecoderPlugin::size()
ErrorOr<void> DDSImageDecoderPlugin::initialize()
{
// The header is always at least 128 bytes, so if the file is smaller, it can't be a DDS.
if (m_context->data_size > 128
&& m_context->data[0] == 0x44
&& m_context->data[1] == 0x44
&& m_context->data[2] == 0x53
&& m_context->data[3] == 0x20)
return {};
return Error::from_string_literal("Bad image magic");
return {};
}
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)