summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorOetkenPurveyorOfCode <[email protected]>2024-05-21 15:44:02 +0200
committerGitHub <[email protected]>2024-05-21 15:44:02 +0200
commit9ef29aff9aa08e64ac2d25048829de7459ee7d25 (patch)
tree40a6656711b585cc0888e3986ef59c1716eacaf1 /src
parentc4a51a3ebdaa3a5bd1414d0b293e1a5100f578f6 (diff)
downloadraylib-9ef29aff9aa08e64ac2d25048829de7459ee7d25.tar.gz
raylib-9ef29aff9aa08e64ac2d25048829de7459ee7d25.zip
[rtextures] Fix Undefined behaviour in ColorToInt (#3996)
Diffstat (limited to 'src')
-rw-r--r--src/rtextures.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/rtextures.c b/src/rtextures.c
index 47ff83f5..ca4c60d1 100644
--- a/src/rtextures.c
+++ b/src/rtextures.c
@@ -4510,9 +4510,7 @@ Color Fade(Color color, float alpha)
// Get hexadecimal value for a Color
int ColorToInt(Color color)
{
- int result = (((int)color.r << 24) | ((int)color.g << 16) | ((int)color.b << 8) | (int)color.a);
-
- return result;
+ return (int)(((unsigned)color.r << 24) | ((unsigned)color.g << 16) | ((unsigned)color.b << 8) | color.a);
}
// Get color normalized as float [0..1]