aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xfree86/modes
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xfree86/modes')
-rw-r--r--xorg-server/hw/xfree86/modes/xf86RandR12.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/xorg-server/hw/xfree86/modes/xf86RandR12.c b/xorg-server/hw/xfree86/modes/xf86RandR12.c
index 66139dcf0..8a04dfc2c 100644
--- a/xorg-server/hw/xfree86/modes/xf86RandR12.c
+++ b/xorg-server/hw/xfree86/modes/xf86RandR12.c
@@ -1256,12 +1256,13 @@ xf86RandR12CrtcSetGamma(ScreenPtr pScreen, RRCrtcPtr randr_crtc)
CARD16 *tmp_ptr;
tmp_ptr =
- realloc(crtc->gamma_red, 3 * crtc->gamma_size * sizeof(CARD16));
+ realloc(crtc->gamma_red,
+ 3 * randr_crtc->gammaSize * sizeof(CARD16));
if (!tmp_ptr)
return FALSE;
crtc->gamma_red = tmp_ptr;
- crtc->gamma_green = crtc->gamma_red + crtc->gamma_size;
- crtc->gamma_blue = crtc->gamma_green + crtc->gamma_size;
+ crtc->gamma_green = crtc->gamma_red + randr_crtc->gammaSize;
+ crtc->gamma_blue = crtc->gamma_green + randr_crtc->gammaSize;
}
crtc->gamma_size = randr_crtc->gammaSize;