[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

libxrandr: Changes to 'upstream-unstable'



 COPYING           |    1 +
 configure.ac      |    2 +-
 src/Xrandr.c      |    3 +++
 src/XrrProvider.c |   11 ++++++++++-
 4 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit 30a7b506ae2071b8d265ce4eaeed1af60bc7ee7b
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Sep 7 21:50:49 2013 -0700

    libXrandr 1.4.2
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/configure.ac b/configure.ac
index 6776233..a4cfbcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,7 +29,7 @@ AC_PREREQ([2.60])
 # digit in the version number to track changes which don't affect the
 # protocol, so Xrandr version l.n.m corresponds to protocol version l.n
 #
-AC_INIT([libXrandr], [1.4.1],
+AC_INIT([libXrandr], [1.4.2],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXrandr])
 AC_CONFIG_SRCDIR([Makefile.am])
 AC_CONFIG_HEADERS([config.h])

commit 293d6b579b243574d98bd5974cce6e5fe48e7613
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sat Sep 7 21:49:52 2013 -0700

    Add copyright notice from src/XrrProvider.c to COPYING
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/COPYING b/COPYING
index 29a2f5d..68bffe8 100644
--- a/COPYING
+++ b/COPYING
@@ -22,6 +22,7 @@ Copyright © 2000 Compaq Computer Corporation, Inc.
 Copyright © 2002 Hewlett-Packard Company, Inc.
 Copyright © 2006 Intel Corporation
 Copyright © 2008 Red Hat, Inc.
+Copyright © 2011 Dave Airlie
 
 Permission to use, copy, modify, distribute, and sell this software and its
 documentation for any purpose is hereby granted without fee, provided that

commit 4e4bbb85499cff052ce03e173b88f1083ba83f86
Author: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
Date:   Mon Jun 14 13:45:08 2010 +0300

    XRRUpdateConfiguration: Check if getting screen for root fails
    
    XRRRootToScreen might return -1 if it fails to find screen for the root
    window.  Following code uses screen number unconditionally to index the
    screen array.
    
    Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com>
    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>

diff --git a/src/Xrandr.c b/src/Xrandr.c
index b1e97ec..a9fba87 100644
--- a/src/Xrandr.c
+++ b/src/Xrandr.c
@@ -483,6 +483,9 @@ int XRRUpdateConfiguration(XEvent *event)
 	scevent = (XRRScreenChangeNotifyEvent *) event;
 	snum = XRRRootToScreen(dpy,
 			       ((XRRScreenChangeNotifyEvent *) event)->root);
+	if (snum < 0)
+	    return 0;
+
 	if (scevent->rotation & (RR_Rotate_90 | RR_Rotate_270)) {
 		dpy->screens[snum].width   = scevent->height;
 		dpy->screens[snum].height  = scevent->width;

commit 9e4abe746786f0f632d1f82f99fe0c6b8ffedf9e
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date:   Sun Jun 30 16:52:59 2013 -0700

    XRRGetProviderInfo returned bad associated_capability list in 64-bit
    
    Unlike most of the values returned by this function, which are arrays
    of XIDs (long int), associated_capability is defined as an array of
    unsigned int.   _XRead32 reads 32-bit values from the wire protocol
    and writes them to the provided buffer as an array of long ints, even
    if that means expanding them from 32-bit to 64-bit.   Doing that for
    associated_capability resulted in a garbage value between each actual
    value, and overflowing the provided buffer into the space for the
    provider name (which is written later and would overwrite the overflowed
    data).
    
    Created xhiv libXrandr/XRRGetProviderInfo test case to test & confirm.
    
    Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>

diff --git a/src/XrrProvider.c b/src/XrrProvider.c
index 309e321..014ddd9 100644
--- a/src/XrrProvider.c
+++ b/src/XrrProvider.c
@@ -156,7 +156,16 @@ XRRGetProviderInfo(Display *dpy, XRRScreenResources *resources, RRProvider provi
     _XRead32(dpy, xpi->outputs, rep.nOutputs << 2);
 
     _XRead32(dpy, xpi->associated_providers, rep.nAssociatedProviders << 2);
-    _XRead32(dpy, xpi->associated_capability, rep.nAssociatedProviders << 2);
+
+    /*
+     * _XRead32 reads a series of 32-bit values from the protocol and writes
+     * them out as a series of "long int" values, but associated_capability
+     * is defined as unsigned int *, so that won't work for this array.
+     * Instead we assume for now that "unsigned int" is also 32-bits, so
+     * the values can be read without any conversion.
+     */
+    _XRead(dpy, (char *) xpi->associated_capability,
+           rep.nAssociatedProviders << 2);
 
     _XReadPad(dpy, xpi->name, rep.nameLength);
     xpi->name[rep.nameLength] = '\0';


Reply to: