From: Dave Airlie <[email protected]>

Al Viro pointed this out on lwn, and I think this patch should fix it,
but making sure we don't do the addition as 32-bit on 64-bit machines.

Reported-by: Al Viro <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
---
 src/XvMC.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/XvMC.c b/src/XvMC.c
index 74c8b85..e1b215e 100644
--- a/src/XvMC.c
+++ b/src/XvMC.c
@@ -575,7 +575,7 @@ Status XvMCGetDRInfo(Display *dpy, XvPortID port,
 
        if (rep.length < (INT_MAX >> 2)) {
            realSize = rep.length << 2;
-           if (realSize >= (rep.nameLen + rep.busIDLen)) {
+           if (realSize >= ((unsigned long)rep.nameLen + (unsigned 
long)rep.busIDLen)) {
                tmpBuf = Xmalloc(realSize);
                *name = Xmalloc(rep.nameLen);
                *busID = Xmalloc(rep.busIDLen);
-- 
1.8.1.2

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to