mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:07:44 +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
1 changed files with 1 additions and 2 deletions
|
@ -1715,7 +1715,6 @@ public:
|
||||||
Error,
|
Error,
|
||||||
HeaderDecoded,
|
HeaderDecoded,
|
||||||
FrameDecoded,
|
FrameDecoded,
|
||||||
BitmapDecoded
|
|
||||||
};
|
};
|
||||||
|
|
||||||
State state() const
|
State state() const
|
||||||
|
@ -1803,7 +1802,7 @@ ErrorOr<ImageFrameDescriptor> JPEGXLImageDecoderPlugin::frame(size_t index, Opti
|
||||||
if (m_context->state() == JPEGXLLoadingContext::State::Error)
|
if (m_context->state() == JPEGXLLoadingContext::State::Error)
|
||||||
return Error::from_string_literal("JPEGXLImageDecoderPlugin: Decoding failed");
|
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());
|
TRY(m_context->decode());
|
||||||
|
|
||||||
return ImageFrameDescriptor { m_context->bitmap(), 0 };
|
return ImageFrameDescriptor { m_context->bitmap(), 0 };
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue