diff options
author | Gunnar Beutner <gbeutner@serenityos.org> | 2021-08-01 07:24:10 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-08-01 11:56:01 +0200 |
commit | 079dec11d3216f650a2773d9d9eba9c87e6c71c3 (patch) | |
tree | 801f85fb44959760569beff0a5cc8b7f1810bb88 /Userland/Libraries | |
parent | e4538ce8efc1e57069a8f743c38623bd5166aeee (diff) | |
download | serenity-079dec11d3216f650a2773d9d9eba9c87e6c71c3.zip |
LibGfx: Fix writing PNG headers on x86_64
m_data.size() returns a size_t which is a 64-bit type on x86_64. This
resulted in us incorrectly using zero in the PNG header.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGfx/PNGWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGfx/PNGWriter.cpp b/Userland/Libraries/LibGfx/PNGWriter.cpp index 4b50f98c80..a87095740e 100644 --- a/Userland/Libraries/LibGfx/PNGWriter.cpp +++ b/Userland/Libraries/LibGfx/PNGWriter.cpp @@ -79,7 +79,7 @@ void PNGChunk::store_type() void PNGChunk::store_data_length() { - auto data_length = BigEndian(m_data.size() - sizeof(data_length_type) - m_type.length()); + auto data_length = BigEndian<u32>(m_data.size() - sizeof(data_length_type) - m_type.length()); __builtin_memcpy(m_data.offset_pointer(0), &data_length, sizeof(u32)); } |