summaryrefslogtreecommitdiff
path: root/src/lib/ecore_x/xcb/ecore_xcb_randr.c
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-24 19:22:31 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2013-07-24 19:22:31 +0900
commite945f0d19654d153a626ff6627d2bbf36191cef8 (patch)
tree165acaa8dd99c1875dd81102d4ec282392123f04 /src/lib/ecore_x/xcb/ecore_xcb_randr.c
parenta48c4cd064b377223203053bd02c29490633b9a5 (diff)
ecore-x: fix randr query when noutputs is 0.
Diffstat (limited to 'src/lib/ecore_x/xcb/ecore_xcb_randr.c')
-rw-r--r--src/lib/ecore_x/xcb/ecore_xcb_randr.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/lib/ecore_x/xcb/ecore_xcb_randr.c b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
index a429b35f03..d74644cd2c 100644
--- a/src/lib/ecore_x/xcb/ecore_xcb_randr.c
+++ b/src/lib/ecore_x/xcb/ecore_xcb_randr.c
@@ -2672,15 +2672,19 @@ ecore_x_randr_window_outputs_get(Ecore_X_Window window,
2672 2672
2673 outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i], 2673 outputs = ecore_x_randr_crtc_outputs_get(root, crtcs[i],
2674 &noutputs); 2674 &noutputs);
2675 if (!outputs) 2675 if (outputs)
2676 goto _ecore_x_randr_current_output_get_fail_free; 2676 {
2677 tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output))); 2677 if (noutputs > 0)
2678 if (!tret) goto _ecore_x_randr_current_output_get_fail_free; 2678 {
2679 ret = tret; 2679 tret = realloc(ret, ((nret + noutputs) * sizeof(Ecore_X_Randr_Output)));
2680 memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output))); 2680 if (!tret) goto _ecore_x_randr_current_output_get_fail_free;
2681 nret += noutputs; 2681 ret = tret;
2682 free(outputs); 2682 memcpy(&ret[nret], outputs, (noutputs * sizeof(Ecore_X_Randr_Output)));
2683 outputs = NULL; 2683 nret += noutputs;
2684 }
2685 free(outputs);
2686 outputs = NULL;
2687 }
2684 } 2688 }
2685 free(crtcs); 2689 free(crtcs);
2686 2690