mirror of https://github.com/mpv-player/mpv
sub: fix undefined behavior in ASS color calculation
This might shift bits into the sign, which is undefined behavior. Making the right operand unsigned was supposed to help with this, but it seems it did nothing, and C99 makes the result type dependent on the left operand only.
This commit is contained in:
parent
3c322b1022
commit
485d033b5f
|
@ -31,7 +31,7 @@
|
|||
#define MP_ASS_FONT_PLAYRESY 288
|
||||
|
||||
#define MP_ASS_RGBA(r, g, b, a) \
|
||||
(((r) << 24U) | ((g) << 16) | ((b) << 8) | (0xFF - (a)))
|
||||
(((unsigned)(r) << 24) | ((g) << 16) | ((b) << 8) | (0xFF - (a)))
|
||||
|
||||
// m_color argument
|
||||
#define MP_ASS_COLOR(c) MP_ASS_RGBA((c).r, (c).g, (c).b, (c).a)
|
||||
|
|
Loading…
Reference in New Issue