summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_x/xlib
diff options
context:
space:
mode:
authorChristopher Michael <cpmichael1@comcast.net>2012-09-11 11:41:26 +0000
committerChristopher Michael <cpmichael1@comcast.net>2012-09-11 11:41:26 +0000
commit4b1e2578b0a2c6e1066adcb5b010e4abfa7f551a (patch)
tree1b905c1b378e3168e7dd81af5391f30ebb5aabb2 /legacy/ecore/src/lib/ecore_x/xlib
parent90f9d623fef874398bfaa5f875abbf8ea71e3115 (diff)
Ecore_X: Fix more memcpy madness causing problems in randr. This fixes
crtc_possible_outputs_get and crtc_outputs_get. SVN revision: 76454
Diffstat (limited to 'legacy/ecore/src/lib/ecore_x/xlib')
-rw-r--r--legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
index 8a00b8b..0ee009a 100644
--- a/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
+++ b/legacy/ecore/src/lib/ecore_x/xlib/ecore_x_randr_12.c
@@ -681,19 +681,19 @@ ecore_x_randr_crtc_outputs_get(Ecore_X_Window root,
681 Ecore_X_Randr_Output *ret = NULL; 681 Ecore_X_Randr_Output *ret = NULL;
682 XRRCrtcInfo *crtc_info = NULL; 682 XRRCrtcInfo *crtc_info = NULL;
683 683
684 if (_ecore_x_randr_crtc_validate(root, 684 if (_ecore_x_randr_crtc_validate(root, crtc) &&
685 crtc) &&
686 (res = 685 (res =
687 _ecore_x_randr_get_screen_resources (_ecore_x_disp, 686 _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)) &&
688 root)) &&
689 (crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc))) 687 (crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
690 { 688 {
691 if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput))) 689 if ((ret = malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->noutput)))
692 { 690 {
693 memcpy(ret, crtc_info->outputs, 691 int i = 0;
694 (sizeof(Ecore_X_Randr_Output) * crtc_info->noutput)); 692
695 if (num) 693 if (num) *num = crtc_info->noutput;
696 *num = crtc_info->noutput; 694
695 for (i = 0; i < crtc_info->noutput; i++)
696 ret[i] = crtc_info->outputs[i];
697 } 697 }
698 698
699 if (crtc_info) 699 if (crtc_info)
@@ -725,8 +725,7 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
725 Ecore_X_Randr_Output *ret = NULL; 725 Ecore_X_Randr_Output *ret = NULL;
726 XRRCrtcInfo *crtc_info = NULL; 726 XRRCrtcInfo *crtc_info = NULL;
727 727
728 if (_ecore_x_randr_crtc_validate(root, 728 if (_ecore_x_randr_crtc_validate(root, crtc) &&
729 crtc) &&
730 (res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root))) 729 (res = _ecore_x_randr_get_screen_resources (_ecore_x_disp, root)))
731 { 730 {
732 if ((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc))) 731 if ((crtc_info = XRRGetCrtcInfo(_ecore_x_disp, res, crtc)))
@@ -734,10 +733,12 @@ ecore_x_randr_crtc_possible_outputs_get(Ecore_X_Window root,
734 if ((ret = 733 if ((ret =
735 malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible))) 734 malloc(sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)))
736 { 735 {
737 memcpy(ret, crtc_info->possible, 736 int i = 0;
738 (sizeof(Ecore_X_Randr_Output) * crtc_info->npossible)); 737
739 if (num) 738 if (num) *num = crtc_info->npossible;
740 *num = res->ncrtc; 739
740 for (i = 0; i < crtc_info->npossible; i++)
741 ret[i] = crtc_info->possible[i];
741 } 742 }
742 743
743 XRRFreeCrtcInfo(crtc_info); 744 XRRFreeCrtcInfo(crtc_info);