Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix shift-sign issue in Convert.c #7838

Merged
merged 3 commits into from
Mar 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/libImaging/Convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -507,10 +507,10 @@ rgba2rgb_(UINT8 *out, const UINT8 *in, int xsize) {
static void
rgbT2rgba(UINT8 *out, int xsize, int r, int g, int b) {
#ifdef WORDS_BIGENDIAN
UINT32 trns = ((r & 0xff) << 24) | ((g & 0xff) << 16) | ((b & 0xff) << 8) | 0xff;
UINT32 trns = ((r & 0xffU) << 24) | ((g & 0xffU) << 16) | ((b & 0xffU) << 8) | 0xffU;
radarhere marked this conversation as resolved.
Show resolved Hide resolved
UINT32 repl = trns & 0xffffff00;
#else
UINT32 trns = (0xff << 24) | ((b & 0xff) << 16) | ((g & 0xff) << 8) | (r & 0xff);
UINT32 trns = (0xffU << 24) | ((b & 0xffU) << 16) | ((g & 0xffU) << 8) | (r & 0xffU);
radarhere marked this conversation as resolved.
Show resolved Hide resolved
UINT32 repl = trns & 0x00ffffff;
#endif

Expand Down
Loading