mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-25 18:58:56 +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
Notes:
sideshowbarker
2024-07-17 02:59:43 +09:00
Author: https://github.com/LucasChollet
Commit: 8946c0c104
Pull-request: https://github.com/SerenityOS/serenity/pull/19875
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.
|
return {};
|
||||||
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");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
|
bool DDSImageDecoderPlugin::sniff(ReadonlyBytes data)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue