diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index 98ab7eb354..bc97b97a44 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -892,6 +892,7 @@ static ErrorOr read_huffman_table(Stream& stream, JPEGLoadingContext& cont } table.codes.ensure_capacity(total_codes); + table.symbols.ensure_capacity(total_codes); // Read symbols. Read X bytes, where X is the sum of the counts of codes read in the previous step. for (u32 i = 0; i < total_codes; i++) {