Explicitly cast to unsigned int before left-shifting
To avoid potential signed integer overflow (undefined behavior), as implicit integer promotion means the operand becomes a (signed) int.
This commit is contained in:
parent
3460814b98
commit
aac1748615
@ -544,9 +544,9 @@ scanline_read_old( VipsSbuf *sbuf, COLR *scanline, int width )
|
||||
if( scanline[0][RED] == 1 &&
|
||||
scanline[0][GRN] == 1 &&
|
||||
scanline[0][BLU] == 1 ) {
|
||||
int i;
|
||||
guint i;
|
||||
|
||||
for( i = scanline[0][EXP] << rshift;
|
||||
for( i = ((guint32) scanline[0][EXP] << rshift);
|
||||
i > 0 && width > 0; i-- ) {
|
||||
copycolr( scanline[0], scanline[-1] );
|
||||
scanline += 1;
|
||||
|
Loading…
Reference in New Issue
Block a user