Skip to content

Commit 1d4cda6

Browse files
committed
Cast to UINT32 before shifting bits
1 parent 6b4bb79 commit 1d4cda6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libImaging/SgiRleDecode.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222

2323
static void
2424
read4B(UINT32 *dest, UINT8 *buf) {
25-
*dest = (UINT32)((buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]);
25+
*dest = ((UINT32)buf[0] << 24) | ((UINT32)buf[1] << 16) | ((UINT32)buf[2] << 8) |
26+
buf[3];
2627
}
2728

2829
/*

0 commit comments

Comments
 (0)