xorg-x11-server/u_render-Cast-color-masks-to-unsigned-long-before-shifting-them.patch
Stefan Dirsch c2276ffaed Accepting request 731423 from home:iznogood:branches:X11:XOrg
- Add U_xwayland-Separate-DamagePtr-into-separate-window-data.patch
  and U_xwayland-Allow-passing-a-fd.patch: Needed for gnome 3.34
  new and experimental xwayland on demand feature.
- Rebase patches with quilt.

OBS-URL: https://build.opensuse.org/request/show/731423
OBS-URL: https://build.opensuse.org/package/show/X11:XOrg/xorg-x11-server?expand=0&rev=744
2019-09-18 12:48:07 +00:00

42 lines
1.7 KiB
Diff

From: Egbert Eich <eich@hammer45.arch.suse.de>
Date: Fri May 30 19:08:00 2014 -0400
Subject: [PATCH]render: Cast color masks to unsigned long before shifting them
Patch-mainline: to be upstreamed
Git-commit: 6ec9a78f9b79668239c3a1519d715cbecf186cef
Git-repo:
References: bnc#876757
Signed-off-by: Egbert Eich <eich@suse.com>
The color masks in DirectFormatRec are CARD16. Shifting them may lead
to unexpected results. Cast them to unsigned long to make sure the
shifted value will still fit into that type.
Signed-off-by: Egbert Eich <eich@suse.de>
---
render/picture.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
Index: xorg-server-1.20.5/render/picture.c
===================================================================
--- xorg-server-1.20.5.orig/render/picture.c
+++ xorg-server-1.20.5/render/picture.c
@@ -527,12 +527,12 @@ PictureMatchVisual(ScreenPtr pScreen, in
return format;
}
else {
- if (format->direct.redMask << format->direct.red ==
- pVisual->redMask &&
- format->direct.greenMask << format->direct.green ==
- pVisual->greenMask &&
- format->direct.blueMask << format->direct.blue ==
- pVisual->blueMask) {
+ if (((unsigned long)format->direct.redMask) <<
+ format->direct.red == pVisual->redMask &&
+ ((unsigned long)format->direct.greenMask) <<
+ format->direct.green == pVisual->greenMask &&
+ ((unsigned long)format->direct.blueMask) <<
+ format->direct.blue == pVisual->blueMask) {
return format;
}
}