1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibGfx/TIFF: Take the TIFF value by rvalue reference in handle_tag()

This commit is contained in:
Lucas CHOLLET 2023-11-12 23:37:59 -05:00 committed by Sam Atkins
parent 4ab2903e25
commit 1afdf7f3c7
Notes: sideshowbarker 2024-07-17 06:40:35 +09:00
3 changed files with 4 additions and 4 deletions

View file

@ -386,7 +386,7 @@ private:
if (checked_size.has_overflow())
return Error::from_string_literal("TIFFImageDecoderPlugin: Invalid tag with too large data");
auto const tiff_value = TRY(([=, this]() -> ErrorOr<Vector<Value>> {
auto tiff_value = TRY(([=, this]() -> ErrorOr<Vector<Value>> {
if (checked_size.value() <= 4) {
auto value = TRY(read_tiff_value(type, count, TRY(m_stream->tell())));
TRY(m_stream->discard(4));
@ -416,7 +416,7 @@ private:
}
}
TRY(handle_tag(m_metadata, tag, type, count, tiff_value));
TRY(handle_tag(m_metadata, tag, type, count, move(tiff_value)));
return {};
}

View file

@ -56,7 +56,7 @@ enum class Predictor {
HorizontalDifferencing = 2,
};
ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value> const& value);
ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value>&& value);
}

View file

@ -10,7 +10,7 @@
namespace Gfx::TIFF {
ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value> const& value)
ErrorOr<void> handle_tag(Metadata& metadata, u16 tag, Type type, u32 count, Vector<Value>&& value)
{
// FIXME: Make that easy to extend
switch (tag) {