Skip to content

Commit

Permalink
Replace addition with bitwise-or in composing 32-bit unsigned data
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBloomberg committed Oct 13, 2024
1 parent bc257bc commit 0e8ac0c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/bmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,8 @@ PIXCMAP *cmap;
* Note that the first 4 bytes give the infoheader size.
* The infoheader pointer on sparc64 is not 32-bit aligned. */
bmpih_b = (l_uint8 *)bmpih;
ihbytes = bmpih_b[0] + ((l_int32)bmpih_b[1] << 8) +
((l_int32)bmpih_b[2] << 16) + ((l_uint32)bmpih_b[3] << 24);
ihbytes = bmpih_b[0] | ((l_int32)bmpih_b[1] << 8) |
((l_int32)bmpih_b[2] << 16) | ((l_uint32)bmpih_b[3] << 24);
width = convertOnBigEnd32(bmpih->biWidth);
height = convertOnBigEnd32(bmpih->biHeight);
depth = convertOnBigEnd16(bmpih->biBitCount);
Expand Down

0 comments on commit 0e8ac0c

Please sign in to comment.