mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibGfx/DDS: Don't double-check the magic number
This is already done in `decode_dds()`.
This commit is contained in:
parent
c336cef065
commit
8946c0c104
1 changed files with 1 additions and 9 deletions
|
@ -634,15 +634,7 @@ IntSize DDSImageDecoderPlugin::size()
|
||||||
|
|
||||||
ErrorOr<void> DDSImageDecoderPlugin::initialize()
|
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 {};
|
||||||
|
|
||||||
return Error::from_string_literal("Bad image magic");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
|
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue