Skip to content

Commit

Permalink
Fix function pixReadMemBmp for big endian hosts
Browse files Browse the repository at this point in the history
Simplify also the code a little bit and remove a comment with test code.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Oct 11, 2024
1 parent af59899 commit 8cad754
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 8cad754

Please sign in to comment.