소스 검색

[rtextures] Fix Undefined behaviour in ColorToInt (#3996)

pull/3999/head
OetkenPurveyorOfCode 10 달 전
committed by GitHub
부모
커밋
9ef29aff9a
No known key found for this signature in database GPG 키 ID: B5690EEEBB952194
1개의 변경된 파일1개의 추가작업 그리고 3개의 파일을 삭제
  1. +1
    -3
      src/rtextures.c

+ 1
- 3
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]

불러오는 중...
취소
저장