diff --git a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.cpp index 52e0898ee1..a638c10932 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.cpp @@ -173,7 +173,7 @@ IntSize QOIImageDecoderPlugin::size() if (m_context->state < QOILoadingContext::State::HeaderDecoded) { // FIXME: This is a weird API (inherited from ImageDecoderPlugin), should probably propagate errors by returning ErrorOr. // For the time being, ignore the result and rely on the context's state. - (void)decode_header_and_update_context(*m_context->stream); + (void)decode_header_and_update_context(); } if (m_context->state == QOILoadingContext::State::Error) @@ -184,7 +184,7 @@ IntSize QOIImageDecoderPlugin::size() ErrorOr QOIImageDecoderPlugin::initialize() { - return decode_header_and_update_context(*m_context->stream); + return decode_header_and_update_context(); } bool QOIImageDecoderPlugin::sniff(ReadonlyBytes data) @@ -208,10 +208,10 @@ ErrorOr QOIImageDecoderPlugin::frame(size_t index, Optiona VERIFY(m_context->state != QOILoadingContext::State::Error); if (m_context->state == QOILoadingContext::State::NotDecoded) { - TRY(decode_header_and_update_context(*m_context->stream)); - TRY(decode_image_and_update_context(*m_context->stream)); + TRY(decode_header_and_update_context()); + TRY(decode_image_and_update_context()); } else if (m_context->state == QOILoadingContext::State::HeaderDecoded) { - TRY(decode_image_and_update_context(*m_context->stream)); + TRY(decode_image_and_update_context()); } VERIFY(m_context->state == QOILoadingContext::State::ImageDecoded); @@ -219,10 +219,10 @@ ErrorOr QOIImageDecoderPlugin::frame(size_t index, Optiona return ImageFrameDescriptor { m_context->bitmap, 0 }; } -ErrorOr QOIImageDecoderPlugin::decode_header_and_update_context(Stream& stream) +ErrorOr QOIImageDecoderPlugin::decode_header_and_update_context() { VERIFY(m_context->state < QOILoadingContext::State::HeaderDecoded); - auto error_or_header = decode_qoi_header(stream); + auto error_or_header = decode_qoi_header(*m_context->stream); if (error_or_header.is_error()) { m_context->state = QOILoadingContext::State::Error; return error_or_header.release_error(); @@ -232,10 +232,10 @@ ErrorOr QOIImageDecoderPlugin::decode_header_and_update_context(Stream& st return {}; } -ErrorOr QOIImageDecoderPlugin::decode_image_and_update_context(Stream& stream) +ErrorOr QOIImageDecoderPlugin::decode_image_and_update_context() { VERIFY(m_context->state < QOILoadingContext::State::ImageDecoded); - auto error_or_bitmap = decode_qoi_image(stream, m_context->header.width, m_context->header.height); + auto error_or_bitmap = decode_qoi_image(*m_context->stream, m_context->header.width, m_context->header.height); if (error_or_bitmap.is_error()) { m_context->state = QOILoadingContext::State::Error; return error_or_bitmap.release_error(); diff --git a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h index 9e16e22acd..4a26592e7c 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h +++ b/Userland/Libraries/LibGfx/ImageFormats/QOILoader.h @@ -54,8 +54,8 @@ public: virtual ErrorOr> icc_data() override; private: - ErrorOr decode_header_and_update_context(Stream&); - ErrorOr decode_image_and_update_context(Stream&); + ErrorOr decode_header_and_update_context(); + ErrorOr decode_image_and_update_context(); QOIImageDecoderPlugin(NonnullOwnPtr);