From ebf77ccdf5a49ac9e35bf08db44c84affc51cc87 Mon Sep 17 00:00:00 2001 From: Mirco Miranda Date: Mon, 9 Feb 2026 09:11:29 +0100 Subject: [PATCH] TGA: fix Undefined-shift --- src/imageformats/tga.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/imageformats/tga.cpp b/src/imageformats/tga.cpp index c6746b1..03af818 100644 --- a/src/imageformats/tga.cpp +++ b/src/imageformats/tga.cpp @@ -731,7 +731,7 @@ static bool LoadTGA(QIODevice *dev, const TgaHeader &tga, QImage &img) if (div == 0) hasAlpha = false; for (int x = x_start; x != x_end; x += x_step) { - const int alpha = hasAlpha ? int((src[3]) << (8 - numAlphaBits)) * 255 / div : 255; + const int alpha = hasAlpha ? int(quint8(src[3]) << (8 - numAlphaBits)) * 255 / div : 255; scanline[x] = qRgba(src[2], src[1], src[0], alpha); src += 4; }