diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.cpp index ba7eb37e46..a9b5e64d5e 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGWriter.cpp @@ -398,8 +398,8 @@ ErrorOr add_quantization_table(Stream& stream, QuantizationTable const& ta // Pq and Tq TRY(stream.write_value((0 << 4) | table.id)); - for (auto coefficient : table.table) - TRY(stream.write_value(coefficient)); + for (u8 i = 0; i < 64; ++i) + TRY(stream.write_value(table.table[zigzag_map[i]])); return {}; }