Skip to content

Commit

Permalink
Merge pull request #752 from stweil/fix
Browse files Browse the repository at this point in the history
Fix function pixReadMemBmp for big endian hosts
  • Loading branch information
DanBloomberg authored Oct 11, 2024
2 parents af59899 + 8cad754 commit f479a27
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/bmpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +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 + (*(bmpih_b + 1) << 8) +
(*(bmpih_b + 2) << 16) + (*(bmpih_b + 3) << 24);
ihbytes = convertOnBigEnd32(ihbytes);
/* lept_stderr("ihbytes = %d\n", ihbytes); */
ihbytes = bmpih_b[0] + (bmpih_b[1] << 8) +
(bmpih_b[2] << 16) + (bmpih_b[3] << 24);
width = convertOnBigEnd32(bmpih->biWidth);
height = convertOnBigEnd32(bmpih->biHeight);
depth = convertOnBigEnd16(bmpih->biBitCount);
Expand Down

0 comments on commit f479a27

Please sign in to comment.