mirror of
https://invent.kde.org/frameworks/kimageformats.git
synced 2026-02-23 08:03:02 -05:00
TGA: fix Undefined-shift
This commit is contained in:
committed by
Albert Astals Cid
parent
359cb039d2
commit
ebf77ccdf5
@ -731,7 +731,7 @@ static bool LoadTGA(QIODevice *dev, const TgaHeader &tga, QImage &img)
|
|||||||
if (div == 0)
|
if (div == 0)
|
||||||
hasAlpha = false;
|
hasAlpha = false;
|
||||||
for (int x = x_start; x != x_end; x += x_step) {
|
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);
|
scanline[x] = qRgba(src[2], src[1], src[0], alpha);
|
||||||
src += 4;
|
src += 4;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user