diff --git a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp index ec74c37594..185fb54af7 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TIFFLoader.cpp @@ -83,7 +83,7 @@ private: if (bits > 8) return value >> (bits - 8); - return value << (8 - bits); + return NumericLimits::max() * value / ((1 << bits) - 1); } ErrorOr read_color(BigEndianInputBitStream& stream)