summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-05-10 10:38:47 +0200
committerwm4 <wm4@nowhere>2014-05-24 16:39:09 +0200
commitee529da7608acdef69f51647fe673289d0cbbda1 (patch)
tree871bbbc4357ca918f129736ac3b72144e33d2a0e
parentc9e6e7cc045f5ac8477b1c4dcfe34c12f0253397 (diff)
downloadmpv-ee529da7608acdef69f51647fe673289d0cbbda1.tar.bz2
mpv-ee529da7608acdef69f51647fe673289d0cbbda1.tar.xz
sub: fix undefined behavior in ASS color calculation (2)
Same problem as previous commit, fix by using the MP_ASS_RGBA() macro.
-rw-r--r--sub/sd_ass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/sd_ass.c b/sub/sd_ass.c
index 8b6f1f1554..e3dc958b26 100644
--- a/sub/sd_ass.c
+++ b/sub/sd_ass.c
@@ -424,10 +424,10 @@ static void mangle_colors(struct sd *sd, struct sub_bitmaps *parts)
int r = (color >> 24u) & 0xff;
int g = (color >> 16u) & 0xff;
int b = (color >> 8u) & 0xff;
- int a = color & 0xff;
+ int a = 0xff - (color & 0xff);
int c[3] = {r, g, b};
mp_map_int_color(vs_rgb2yuv, 8, c);
mp_map_int_color(vs2rgb, 8, c);
- sb->libass.color = (c[0] << 24u) | (c[1] << 16) | (c[2] << 8) | a;
+ sb->libass.color = MP_ASS_RGBA(c[0], c[1], c[2], a);
}
}