| @@ -50,27 +50,27 @@ XRRGetProviderResources(Display *dpy, Wi | | | @@ -50,27 +50,27 @@ XRRGetProviderResources(Display *dpy, Wi |
50 | | | 50 | |
51 | GetReq(RRGetProviders, req); | | 51 | GetReq(RRGetProviders, req); |
52 | req->reqType = info->codes->major_opcode; | | 52 | req->reqType = info->codes->major_opcode; |
53 | req->randrReqType = X_RRGetProviders; | | 53 | req->randrReqType = X_RRGetProviders; |
54 | req->window = window; | | 54 | req->window = window; |
55 | | | 55 | |
56 | if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) | | 56 | if (!_XReply (dpy, (xReply *) &rep, 0, xFalse)) |
57 | { | | 57 | { |
58 | UnlockDisplay (dpy); | | 58 | UnlockDisplay (dpy); |
59 | SyncHandle (); | | 59 | SyncHandle (); |
60 | return NULL; | | 60 | return NULL; |
61 | } | | 61 | } |
62 | | | 62 | |
63 | if (rep.length < INT_MAX >> 2) { | | 63 | if (rep.length < (INT_MAX >> 2)) { |
64 | nbytes = (long) rep.length << 2; | | 64 | nbytes = (long) rep.length << 2; |
65 | | | 65 | |
66 | nbytesRead = (long) (rep.nProviders * 4); | | 66 | nbytesRead = (long) (rep.nProviders * 4); |
67 | | | 67 | |
68 | rbytes = (sizeof(XRRProviderResources) + rep.nProviders * | | 68 | rbytes = (sizeof(XRRProviderResources) + rep.nProviders * |
69 | sizeof(RRProvider)); | | 69 | sizeof(RRProvider)); |
70 | xrpr = (XRRProviderResources *) Xmalloc(rbytes); | | 70 | xrpr = (XRRProviderResources *) Xmalloc(rbytes); |
71 | } else { | | 71 | } else { |
72 | nbytes = 0; | | 72 | nbytes = 0; |
73 | nbytesRead = 0; | | 73 | nbytesRead = 0; |
74 | rbytes = 0; | | 74 | rbytes = 0; |
75 | xrpr = NULL; | | 75 | xrpr = NULL; |
76 | } | | 76 | } |
| @@ -120,29 +120,29 @@ XRRGetProviderInfo(Display *dpy, XRRScre | | | @@ -120,29 +120,29 @@ XRRGetProviderInfo(Display *dpy, XRRScre |
120 | GetReq (RRGetProviderInfo, req); | | 120 | GetReq (RRGetProviderInfo, req); |
121 | req->reqType = info->codes->major_opcode; | | 121 | req->reqType = info->codes->major_opcode; |
122 | req->randrReqType = X_RRGetProviderInfo; | | 122 | req->randrReqType = X_RRGetProviderInfo; |
123 | req->provider = provider; | | 123 | req->provider = provider; |
124 | req->configTimestamp = resources->configTimestamp; | | 124 | req->configTimestamp = resources->configTimestamp; |
125 | | | 125 | |
126 | if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse)) | | 126 | if (!_XReply (dpy, (xReply *) &rep, ProviderInfoExtra >> 2, xFalse)) |
127 | { | | 127 | { |
128 | UnlockDisplay (dpy); | | 128 | UnlockDisplay (dpy); |
129 | SyncHandle (); | | 129 | SyncHandle (); |
130 | return NULL; | | 130 | return NULL; |
131 | } | | 131 | } |
132 | | | 132 | |
133 | if (rep.length > INT_MAX >> 2 || rep.length < ProviderInfoExtra >> 2) | | 133 | if (rep.length > (INT_MAX >> 2) || rep.length < (ProviderInfoExtra >> 2)) |
134 | { | | 134 | { |
135 | if (rep.length < ProviderInfoExtra >> 2) | | 135 | if (rep.length < (ProviderInfoExtra >> 2)) |
136 | _XEatDataWords (dpy, rep.length); | | 136 | _XEatDataWords (dpy, rep.length); |
137 | else | | 137 | else |
138 | _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2)); | | 138 | _XEatDataWords (dpy, rep.length - (ProviderInfoExtra >> 2)); |
139 | UnlockDisplay (dpy); | | 139 | UnlockDisplay (dpy); |
140 | SyncHandle (); | | 140 | SyncHandle (); |
141 | return NULL; | | 141 | return NULL; |
142 | } | | 142 | } |
143 | | | 143 | |
144 | nbytes = ((long) rep.length << 2) - ProviderInfoExtra; | | 144 | nbytes = ((long) rep.length << 2) - ProviderInfoExtra; |
145 | | | 145 | |
146 | nbytesRead = (long)(rep.nCrtcs * 4 + | | 146 | nbytesRead = (long)(rep.nCrtcs * 4 + |
147 | rep.nOutputs * 4 + | | 147 | rep.nOutputs * 4 + |
148 | rep.nAssociatedProviders * 8 + | | 148 | rep.nAssociatedProviders * 8 + |