summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPetri Hintukainen <phintuka@users.sourceforge.net>2014-04-22 15:33:44 +0300
committerPetri Hintukainen <phintuka@users.sourceforge.net>2014-04-22 15:33:44 +0300
commitb5c806222e22d7824490e9fb76fd537110013de8 (patch)
tree83bf544fbb6e2b5b83f81ce0af6f4106f8db3265 /src
parent59a458e756ee8dd7b99f6180047de1d4cf13341a (diff)
downloadxine-lib-b5c806222e22d7824490e9fb76fd537110013de8.tar.gz
xine-lib-b5c806222e22d7824490e9fb76fd537110013de8.tar.bz2
fix aliasing in xcbosd.c
Diffstat (limited to 'src')
-rw-r--r--src/video_out/xcbosd.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/video_out/xcbosd.c b/src/video_out/xcbosd.c
index 538bb32e5..130fcfbbd 100644
--- a/src/video_out/xcbosd.c
+++ b/src/video_out/xcbosd.c
@@ -473,26 +473,31 @@ void xcbosd_blend(xcbosd *osd, vo_overlay_t *overlay)
if (overlay->rle[i].color > max_palette_colour[use_clip_palette]) {
int j;
- clut_t *src_clut;
+ uint32_t *src_color;
uint8_t *src_trans;
if (use_clip_palette) {
- src_clut = (clut_t *)&overlay->hili_color;
+ src_color = overlay->hili_color;
src_trans = (uint8_t *)&overlay->hili_trans;
}
else {
- src_clut = (clut_t *)&overlay->color;
+ src_color = overlay->color;
src_trans = (uint8_t *)&overlay->trans;
}
for (j=max_palette_colour[use_clip_palette]+1; j<=overlay->rle[i].color; j++) {
if (src_trans[j]) {
+ union {
+ uint32_t u32;
+ clut_t c;
+ } tmp = { src_color[j] };
+
if (1) {
int red, green, blue;
int y, u, v, r, g, b;
- y = saturate(src_clut[j].y, 16, 235);
- u = saturate(src_clut[j].cb, 16, 240);
- v = saturate(src_clut[j].cr, 16, 240);
+ y = saturate(tmp.c.y, 16, 235);
+ u = saturate(tmp.c.cb, 16, 240);
+ v = saturate(tmp.c.cr, 16, 240);
y = (9 * y) / 8;
r = y + (25 * v) / 16 - 218;
red = (65536 * saturate(r, 0, 255)) / 256;
@@ -508,7 +513,7 @@ void xcbosd_blend(xcbosd *osd, vo_overlay_t *overlay)
free(alloc_color_reply);
}
else {
- if (src_clut[j].y > 127) {
+ if (tmp.c.y > 127) {
palette[use_clip_palette][j] = osd->screen->white_pixel;
}
else {