mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 10:06:03 +00:00
LibGfx/JPEGXL: Remove the BitmapDecoded
state
There was a confusion between both `BitmapDecoded` and `FrameDecoded` states. Removing one of them, solves the issue. This patch removes the crash caused by requesting the same frame twice.
This commit is contained in:
parent
33ca35f1c7
commit
697803efcc
Notes:
sideshowbarker
2024-07-17 08:34:29 +09:00
Author: https://github.com/LucasChollet
Commit: 697803efcc
Pull-request: https://github.com/SerenityOS/serenity/pull/20151
1 changed files with 1 additions and 2 deletions
|
@ -1715,7 +1715,6 @@ public:
|
|||
Error,
|
||||
HeaderDecoded,
|
||||
FrameDecoded,
|
||||
BitmapDecoded
|
||||
};
|
||||
|
||||
State state() const
|
||||
|
@ -1803,7 +1802,7 @@ ErrorOr<ImageFrameDescriptor> JPEGXLImageDecoderPlugin::frame(size_t index, Opti
|
|||
if (m_context->state() == JPEGXLLoadingContext::State::Error)
|
||||
return Error::from_string_literal("JPEGXLImageDecoderPlugin: Decoding failed");
|
||||
|
||||
if (m_context->state() < JPEGXLLoadingContext::State::BitmapDecoded)
|
||||
if (m_context->state() < JPEGXLLoadingContext::State::FrameDecoded)
|
||||
TRY(m_context->decode());
|
||||
|
||||
return ImageFrameDescriptor { m_context->bitmap(), 0 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue