From 0e8ac0cfaf683b7138b8543bfce1ab3c6bbda322 Mon Sep 17 00:00:00 2001 From: danblooomberg Date: Sun, 13 Oct 2024 08:05:19 -0700 Subject: [PATCH] Replace addition with bitwise-or in composing 32-bit unsigned data --- src/bmpio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bmpio.c b/src/bmpio.c index 3d81d9813..7dd6cd8a6 100644 --- a/src/bmpio.c +++ b/src/bmpio.c @@ -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);