Skip to content

set_gamma_info: remove unnecessary round-trip to server

Alan Coopersmith requested to merge alanc/xrandr:gamma_size into master

XRRGetCrtcGamma() returns the exact same size information as XRRGetCrtcGammaSize(), so just use it instead of waiting for the X server to send it an extra time.

(And if something has gone very wrong so that they aren't the same, this avoids out-of-bounds reads processing the returned gamma arrays by using the size of the arrays we allocated.)

Reported-by: Gregory James DUCK

Merge request reports