diff --git a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp index df62aba422..020ada9f9e 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/JPEGLoader.cpp @@ -250,7 +250,7 @@ struct JPEGLoadingContext { u16 dc_restart_interval { 0 }; HashMap dc_tables; HashMap ac_tables; - Array previous_dc_values {}; + Array previous_dc_values {}; MacroblockMeta mblock_meta; OwnPtr stream; @@ -366,7 +366,7 @@ static ErrorOr add_dc(JPEGLoadingContext& context, Macroblock& macroblock, } // DC coefficients are encoded as the difference between previous and current DC values. - i32 dc_diff = TRY(read_huffman_bits(scan.huffman_stream, dc_length)); + i16 dc_diff = TRY(read_huffman_bits(scan.huffman_stream, dc_length)); // If MSB in diff is 0, the difference is -ve. Otherwise +ve. if (dc_length != 0 && dc_diff < (1 << (dc_length - 1)))