• Giuseppe Bilotta's avatar
    randr: always realloc crtcs and outputs · 4e059d57
    Giuseppe Bilotta authored
    Backported from X.org:
    
       commit 16381d186e7c791031392ed8afcfd33009854e9e
       Author: Giuseppe Bilotta giuseppe.bilotta@gmail.com
       Date: Thu Nov 9 10:21:20 2017 +0100
    
       randr: always realloc crtcs and outputs
    
       When the last crtc (resp. output) is destroyed, the rrScrPriv crtcs
       (resp. outputs) fields do not get cleared, which can lead to a situation
       where the private's numCrtcs (resp. numOutputs) field is zero, but the
       associated memory is still allocated. Just checking if numCrtcs (resp.
       numOutputs) is zero is thus not a good criteria to determine whetehr to
       use a realloc or a malloc.
    
       Since crtcs (resp. outputs) are NULL-initialized anyway, relying on
       numCrtcs (resp. numOutputs) is actually unnecessary, because
       reallocation of a NULL ptr is equivalent to a malloc anyway.
    
       Therefore, just use realloc() unconditionally, and ensure that the
       fields are properly initialized.
    Reviewed-by: 's avatarAdam Jackson <ajax@redhat.com>
    Signed-off-by: 's avatarGiuseppe Bilotta <giuseppe.bilotta@gmail.com>
    Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
    
    Fixes ArcticaProject/nx-libs#558
    4e059d57
Name
Last commit
Last update
debian Loading commit data...
doc Loading commit data...
etc Loading commit data...
m4 Loading commit data...
nx-X11 Loading commit data...
nxcomp Loading commit data...
nxcompshad Loading commit data...
nxproxy Loading commit data...
testscripts Loading commit data...
.gitignore Loading commit data...
COPYING Loading commit data...
ChangeLog Loading commit data...
LICENSE Loading commit data...
LICENSE.nxcomp Loading commit data...
Makefile Loading commit data...
README.NX-development Loading commit data...
README.md Loading commit data...
VERSION Loading commit data...
fix-patch-whitespace Loading commit data...
make-changelog.sh Loading commit data...
mesa-quilt Loading commit data...
nx-libs.spec Loading commit data...
regenerate-symbol-docs.sh Loading commit data...
replace.sh Loading commit data...
roll-tarballs.sh Loading commit data...
version.sh Loading commit data...