File: | glx/singlepixswap.c |
Location: | line 266, column 5 |
Description: | Call to 'realloc' has an allocation size of 0 bytes |
1 | /* | |||||
2 | * SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008) | |||||
3 | * Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved. | |||||
4 | * | |||||
5 | * Permission is hereby granted, free of charge, to any person obtaining a | |||||
6 | * copy of this software and associated documentation files (the "Software"), | |||||
7 | * to deal in the Software without restriction, including without limitation | |||||
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||||
9 | * and/or sell copies of the Software, and to permit persons to whom the | |||||
10 | * Software is furnished to do so, subject to the following conditions: | |||||
11 | * | |||||
12 | * The above copyright notice including the dates of first publication and | |||||
13 | * either this permission notice or a reference to | |||||
14 | * http://oss.sgi.com/projects/FreeB/ | |||||
15 | * shall be included in all copies or substantial portions of the Software. | |||||
16 | * | |||||
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||||
18 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||||
19 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||||
20 | * SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | |||||
21 | * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF | |||||
22 | * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |||||
23 | * SOFTWARE. | |||||
24 | * | |||||
25 | * Except as contained in this notice, the name of Silicon Graphics, Inc. | |||||
26 | * shall not be used in advertising or otherwise to promote the sale, use or | |||||
27 | * other dealings in this Software without prior written authorization from | |||||
28 | * Silicon Graphics, Inc. | |||||
29 | */ | |||||
30 | ||||||
31 | #ifdef HAVE_DIX_CONFIG_H1 | |||||
32 | #include <dix-config.h> | |||||
33 | #endif | |||||
34 | ||||||
35 | #include "glxserver.h" | |||||
36 | #include "glxext.h" | |||||
37 | #include "singlesize.h" | |||||
38 | #include "unpack.h" | |||||
39 | #include "indirect_dispatch.h" | |||||
40 | #include "indirect_size_get.h" | |||||
41 | ||||||
42 | int | |||||
43 | __glXDispSwap_ReadPixels(__GLXclientState * cl, GLbyte * pc) | |||||
44 | { | |||||
45 | GLsizei width, height; | |||||
46 | GLenum format, type; | |||||
47 | GLboolean swapBytes, lsbFirst; | |||||
48 | GLint compsize; | |||||
49 | ||||||
50 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
51 | __GLXcontext *cx; | |||||
52 | ClientPtr client = cl->client; | |||||
53 | int error; | |||||
54 | char *answer, answerBuffer[200]; | |||||
55 | ||||||
56 | REQUEST_FIXED_SIZE(xGLXSingleReq, 28)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((28) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (28) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
57 | ||||||
58 | __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag)sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3] = sw; sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2] = sw;; | |||||
59 | cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag), &error); | |||||
60 | if (!cx) { | |||||
61 | return error; | |||||
62 | } | |||||
63 | ||||||
64 | pc += __GLX_SINGLE_HDR_SIZE8; | |||||
65 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
66 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
67 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
68 | __GLX_SWAP_INT(pc + 12)sw = ((GLbyte *)(pc + 12))[0]; ((GLbyte *)(pc + 12))[0] = ((GLbyte *)(pc + 12))[3]; ((GLbyte *)(pc + 12))[3] = sw; sw = ((GLbyte *)(pc + 12))[1]; ((GLbyte *)(pc + 12))[1] = ((GLbyte *)(pc + 12))[2]; ((GLbyte *)(pc + 12))[2] = sw;; | |||||
69 | __GLX_SWAP_INT(pc + 16)sw = ((GLbyte *)(pc + 16))[0]; ((GLbyte *)(pc + 16))[0] = ((GLbyte *)(pc + 16))[3]; ((GLbyte *)(pc + 16))[3] = sw; sw = ((GLbyte *)(pc + 16))[1]; ((GLbyte *)(pc + 16))[1] = ((GLbyte *)(pc + 16))[2]; ((GLbyte *)(pc + 16))[2] = sw;; | |||||
70 | __GLX_SWAP_INT(pc + 20)sw = ((GLbyte *)(pc + 20))[0]; ((GLbyte *)(pc + 20))[0] = ((GLbyte *)(pc + 20))[3]; ((GLbyte *)(pc + 20))[3] = sw; sw = ((GLbyte *)(pc + 20))[1]; ((GLbyte *)(pc + 20))[1] = ((GLbyte *)(pc + 20))[2]; ((GLbyte *)(pc + 20))[2] = sw;; | |||||
71 | ||||||
72 | width = *(GLsizei *) (pc + 8); | |||||
73 | height = *(GLsizei *) (pc + 12); | |||||
74 | format = *(GLenum *) (pc + 16); | |||||
75 | type = *(GLenum *) (pc + 20); | |||||
76 | swapBytes = *(GLboolean *) (pc + 24); | |||||
77 | lsbFirst = *(GLboolean *) (pc + 25); | |||||
78 | compsize = __glReadPixels_size(format, type, width, height); | |||||
79 | if (compsize < 0) | |||||
80 | return BadLength16; | |||||
81 | ||||||
82 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
83 | glPixelStorei(GL_PACK_LSB_FIRST0x0D01, lsbFirst); | |||||
84 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
85 | __glXClearErrorOccured(); | |||||
86 | glReadPixels(*(GLint *) (pc + 0), *(GLint *) (pc + 4), | |||||
87 | *(GLsizei *) (pc + 8), *(GLsizei *) (pc + 12), | |||||
88 | *(GLenum *) (pc + 16), *(GLenum *) (pc + 20), answer); | |||||
89 | ||||||
90 | if (__glXErrorOccured()) { | |||||
91 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
92 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
93 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
94 | } | |||||
95 | else { | |||||
96 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
97 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
98 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
99 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
100 | } | |||||
101 | cx->hasUnflushedCommands = GL_FALSE0x0; | |||||
102 | return Success0; | |||||
103 | } | |||||
104 | ||||||
105 | int | |||||
106 | __glXDispSwap_GetTexImage(__GLXclientState * cl, GLbyte * pc) | |||||
107 | { | |||||
108 | GLint level, compsize; | |||||
109 | GLenum format, type, target; | |||||
110 | GLboolean swapBytes; | |||||
111 | ||||||
112 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
113 | __GLXcontext *cx; | |||||
114 | ClientPtr client = cl->client; | |||||
115 | int error; | |||||
116 | char *answer, answerBuffer[200]; | |||||
117 | GLint width = 0, height = 0, depth = 1; | |||||
118 | ||||||
119 | REQUEST_FIXED_SIZE(xGLXSingleReq, 20)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((20) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (20) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
120 | ||||||
121 | __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag)sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3] = sw; sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2] = sw;; | |||||
122 | cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag), &error); | |||||
123 | if (!cx) { | |||||
124 | return error; | |||||
125 | } | |||||
126 | ||||||
127 | pc += __GLX_SINGLE_HDR_SIZE8; | |||||
128 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
129 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
130 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
131 | __GLX_SWAP_INT(pc + 12)sw = ((GLbyte *)(pc + 12))[0]; ((GLbyte *)(pc + 12))[0] = ((GLbyte *)(pc + 12))[3]; ((GLbyte *)(pc + 12))[3] = sw; sw = ((GLbyte *)(pc + 12))[1]; ((GLbyte *)(pc + 12))[1] = ((GLbyte *)(pc + 12))[2]; ((GLbyte *)(pc + 12))[2] = sw;; | |||||
132 | ||||||
133 | level = *(GLint *) (pc + 4); | |||||
134 | format = *(GLenum *) (pc + 8); | |||||
135 | type = *(GLenum *) (pc + 12); | |||||
136 | target = *(GLenum *) (pc + 0); | |||||
137 | swapBytes = *(GLboolean *) (pc + 16); | |||||
138 | ||||||
139 | glGetTexLevelParameteriv(target, level, GL_TEXTURE_WIDTH0x1000, &width); | |||||
140 | glGetTexLevelParameteriv(target, level, GL_TEXTURE_HEIGHT0x1001, &height); | |||||
141 | if (target == GL_TEXTURE_3D0x806F) { | |||||
142 | glGetTexLevelParameteriv(target, level, GL_TEXTURE_DEPTH0x8071, &depth); | |||||
143 | } | |||||
144 | /* | |||||
145 | * The three queries above might fail if we're in a state where queries | |||||
146 | * are illegal, but then width, height, and depth would still be zero anyway. | |||||
147 | */ | |||||
148 | compsize = | |||||
149 | __glGetTexImage_size(target, level, format, type, width, height, depth); | |||||
150 | if (compsize < 0) | |||||
151 | return BadLength16; | |||||
152 | ||||||
153 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
154 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
155 | __glXClearErrorOccured(); | |||||
156 | glGetTexImage(*(GLenum *) (pc + 0), *(GLint *) (pc + 4), | |||||
157 | *(GLenum *) (pc + 8), *(GLenum *) (pc + 12), answer); | |||||
158 | ||||||
159 | if (__glXErrorOccured()) { | |||||
160 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
161 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
162 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
163 | } | |||||
164 | else { | |||||
165 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
166 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
167 | __GLX_SWAP_INT(&width)sw = ((GLbyte *)(&width))[0]; ((GLbyte *)(&width))[0] = ((GLbyte *)(&width))[3]; ((GLbyte *)(&width))[3] = sw; sw = ((GLbyte *)(&width))[1]; ((GLbyte *)(&width ))[1] = ((GLbyte *)(&width))[2]; ((GLbyte *)(&width)) [2] = sw;; | |||||
168 | __GLX_SWAP_INT(&height)sw = ((GLbyte *)(&height))[0]; ((GLbyte *)(&height))[ 0] = ((GLbyte *)(&height))[3]; ((GLbyte *)(&height))[ 3] = sw; sw = ((GLbyte *)(&height))[1]; ((GLbyte *)(& height))[1] = ((GLbyte *)(&height))[2]; ((GLbyte *)(& height))[2] = sw;; | |||||
169 | __GLX_SWAP_INT(&depth)sw = ((GLbyte *)(&depth))[0]; ((GLbyte *)(&depth))[0] = ((GLbyte *)(&depth))[3]; ((GLbyte *)(&depth))[3] = sw; sw = ((GLbyte *)(&depth))[1]; ((GLbyte *)(&depth ))[1] = ((GLbyte *)(&depth))[2]; ((GLbyte *)(&depth)) [2] = sw;; | |||||
170 | ((xGLXGetTexImageReply *) &__glXReply)->width = width; | |||||
171 | ((xGLXGetTexImageReply *) &__glXReply)->height = height; | |||||
172 | ((xGLXGetTexImageReply *) &__glXReply)->depth = depth; | |||||
173 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
174 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
175 | } | |||||
176 | return Success0; | |||||
177 | } | |||||
178 | ||||||
179 | int | |||||
180 | __glXDispSwap_GetPolygonStipple(__GLXclientState * cl, GLbyte * pc) | |||||
181 | { | |||||
182 | GLboolean lsbFirst; | |||||
183 | __GLXcontext *cx; | |||||
184 | ClientPtr client = cl->client; | |||||
185 | int error; | |||||
186 | GLubyte answerBuffer[200]; | |||||
187 | char *answer; | |||||
188 | ||||||
189 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
190 | ||||||
191 | REQUEST_FIXED_SIZE(xGLXSingleReq, 4)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((4) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (4) + 3) >> 2) != (uint64_t) client ->req_len)) return(16); | |||||
192 | ||||||
193 | __GLX_SWAP_INT(&((xGLXSingleReq *) pc)->contextTag)sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag)) [0] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag) )[3] = sw; sw = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[1] = ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2]; ((GLbyte *)(&((xGLXSingleReq *) pc)->contextTag ))[2] = sw;; | |||||
194 | cx = __glXForceCurrent(cl, __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag), &error); | |||||
195 | if (!cx) { | |||||
196 | return error; | |||||
197 | } | |||||
198 | pc += __GLX_SINGLE_HDR_SIZE8; | |||||
199 | lsbFirst = *(GLboolean *) (pc + 0); | |||||
200 | ||||||
201 | glPixelStorei(GL_PACK_LSB_FIRST0x0D01, lsbFirst); | |||||
202 | __GLX_GET_ANSWER_BUFFER(answer, cl, 128, 1)if (128 < 0) return 16; else if ((128) > sizeof(answerBuffer )) { int bump; if ((cl)->returnBufSize < (128)+(1)) { ( cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf, (128 )+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (128)+(1); } answer = (char*)cl->returnBuf; bump = (long )(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
203 | ||||||
204 | __glXClearErrorOccured(); | |||||
205 | glGetPolygonStipple((GLubyte *) answer); | |||||
206 | if (__glXErrorOccured()) { | |||||
207 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
208 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
209 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
210 | } | |||||
211 | else { | |||||
212 | __GLX_BEGIN_REPLY(128)__glXReply.length = (((128)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
213 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
214 | __GLX_SEND_HEADER()WriteToClient (client, 32, &__glXReply);; | |||||
215 | __GLX_SEND_BYTE_ARRAY(128)WriteToClient(client, ((((128)*1)+3) & (GLuint)~3), answer ); | |||||
216 | } | |||||
217 | return Success0; | |||||
218 | } | |||||
219 | ||||||
220 | static int | |||||
221 | GetSeparableFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) | |||||
222 | { | |||||
223 | GLint compsize, compsize2; | |||||
224 | GLenum format, type, target; | |||||
225 | GLboolean swapBytes; | |||||
226 | __GLXcontext *cx; | |||||
227 | ClientPtr client = cl->client; | |||||
228 | int error; | |||||
229 | ||||||
230 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
231 | char *answer, answerBuffer[200]; | |||||
232 | GLint width = 0, height = 0; | |||||
233 | ||||||
234 | cx = __glXForceCurrent(cl, tag, &error); | |||||
235 | if (!cx) { | |||||
236 | return error; | |||||
237 | } | |||||
238 | ||||||
239 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
240 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
241 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
242 | ||||||
243 | format = *(GLenum *) (pc + 4); | |||||
244 | type = *(GLenum *) (pc + 8); | |||||
245 | target = *(GLenum *) (pc + 0); | |||||
246 | swapBytes = *(GLboolean *) (pc + 12); | |||||
247 | ||||||
248 | /* target must be SEPARABLE_2D, however I guess we can let the GL | |||||
249 | barf on this one.... */ | |||||
250 | ||||||
251 | glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH0x8018, &width); | |||||
252 | glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT0x8019, &height); | |||||
253 | /* | |||||
254 | * The two queries above might fail if we're in a state where queries | |||||
255 | * are illegal, but then width and height would still be zero anyway. | |||||
256 | */ | |||||
257 | compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); | |||||
258 | compsize2 = __glGetTexImage_size(target, 1, format, type, height, 1, 1); | |||||
259 | ||||||
260 | if ((compsize = safe_pad(compsize)) < 0) | |||||
261 | return BadLength16; | |||||
262 | if ((compsize2 = safe_pad(compsize2)) < 0) | |||||
263 | return BadLength16; | |||||
264 | ||||||
265 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
266 | __GLX_GET_ANSWER_BUFFER(answer, cl, safe_add(compsize, compsize2), 1)if (safe_add(compsize, compsize2) < 0) return 16; else if ( (safe_add(compsize, compsize2)) > sizeof(answerBuffer)) { int bump; if ((cl)->returnBufSize < (safe_add(compsize, compsize2 ))+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)->returnBuf , (safe_add(compsize, compsize2))+(1)); if (!(cl)->returnBuf ) { return 11; } (cl)->returnBufSize = (safe_add(compsize, compsize2))+(1); } answer = (char*)cl->returnBuf; bump = ( long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
| ||||||
267 | __glXClearErrorOccured(); | |||||
268 | glGetSeparableFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), | |||||
269 | *(GLenum *) (pc + 8), answer, answer + compsize, NULL((void*)0)); | |||||
270 | ||||||
271 | if (__glXErrorOccured()) { | |||||
272 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
273 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
274 | } | |||||
275 | else { | |||||
276 | __GLX_BEGIN_REPLY(compsize + compsize2)__glXReply.length = (((compsize + compsize2)+3) & (GLuint )~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
277 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
278 | __GLX_SWAP_INT(&width)sw = ((GLbyte *)(&width))[0]; ((GLbyte *)(&width))[0] = ((GLbyte *)(&width))[3]; ((GLbyte *)(&width))[3] = sw; sw = ((GLbyte *)(&width))[1]; ((GLbyte *)(&width ))[1] = ((GLbyte *)(&width))[2]; ((GLbyte *)(&width)) [2] = sw;; | |||||
279 | __GLX_SWAP_INT(&height)sw = ((GLbyte *)(&height))[0]; ((GLbyte *)(&height))[ 0] = ((GLbyte *)(&height))[3]; ((GLbyte *)(&height))[ 3] = sw; sw = ((GLbyte *)(&height))[1]; ((GLbyte *)(& height))[1] = ((GLbyte *)(&height))[2]; ((GLbyte *)(& height))[2] = sw;; | |||||
280 | ((xGLXGetSeparableFilterReply *) &__glXReply)->width = width; | |||||
281 | ((xGLXGetSeparableFilterReply *) &__glXReply)->height = height; | |||||
282 | __GLX_SEND_VOID_ARRAY(compsize + compsize2)WriteToClient(client, ((((compsize + compsize2)*1)+3) & ( GLuint)~3), answer); | |||||
283 | } | |||||
284 | ||||||
285 | return Success0; | |||||
286 | } | |||||
287 | ||||||
288 | int | |||||
289 | __glXDispSwap_GetSeparableFilter(__GLXclientState * cl, GLbyte * pc) | |||||
290 | { | |||||
291 | const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag); | |||||
292 | ClientPtr client = cl->client; | |||||
293 | ||||||
294 | REQUEST_FIXED_SIZE(xGLXSingleReq, 16)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((16) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
295 | return GetSeparableFilter(cl, pc + __GLX_SINGLE_HDR_SIZE8, tag); | |||||
296 | } | |||||
297 | ||||||
298 | int | |||||
299 | __glXDispSwap_GetSeparableFilterEXT(__GLXclientState * cl, GLbyte * pc) | |||||
300 | { | |||||
301 | const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc)(((xGLXVendorPrivateReq*)pc)->contextTag); | |||||
302 | ClientPtr client = cl->client; | |||||
303 | ||||||
304 | REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16)if (((sizeof(xGLXVendorPrivateReq) >> 2) > client-> req_len) || (((16) >> 2) >= client->req_len) || ( (((uint64_t) sizeof(xGLXVendorPrivateReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
305 | return GetSeparableFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE12, tag); | |||||
| ||||||
306 | } | |||||
307 | ||||||
308 | static int | |||||
309 | GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) | |||||
310 | { | |||||
311 | GLint compsize; | |||||
312 | GLenum format, type, target; | |||||
313 | GLboolean swapBytes; | |||||
314 | __GLXcontext *cx; | |||||
315 | ClientPtr client = cl->client; | |||||
316 | int error; | |||||
317 | ||||||
318 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
319 | char *answer, answerBuffer[200]; | |||||
320 | GLint width = 0, height = 0; | |||||
321 | ||||||
322 | cx = __glXForceCurrent(cl, tag, &error); | |||||
323 | if (!cx) { | |||||
324 | return error; | |||||
325 | } | |||||
326 | ||||||
327 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
328 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
329 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
330 | ||||||
331 | format = *(GLenum *) (pc + 4); | |||||
332 | type = *(GLenum *) (pc + 8); | |||||
333 | target = *(GLenum *) (pc + 0); | |||||
334 | swapBytes = *(GLboolean *) (pc + 12); | |||||
335 | ||||||
336 | glGetConvolutionParameteriv(target, GL_CONVOLUTION_WIDTH0x8018, &width); | |||||
337 | if (target == GL_CONVOLUTION_2D0x8011) { | |||||
338 | height = 1; | |||||
339 | } | |||||
340 | else { | |||||
341 | glGetConvolutionParameteriv(target, GL_CONVOLUTION_HEIGHT0x8019, &height); | |||||
342 | } | |||||
343 | /* | |||||
344 | * The two queries above might fail if we're in a state where queries | |||||
345 | * are illegal, but then width and height would still be zero anyway. | |||||
346 | */ | |||||
347 | compsize = __glGetTexImage_size(target, 1, format, type, width, height, 1); | |||||
348 | if (compsize < 0) | |||||
349 | return BadLength16; | |||||
350 | ||||||
351 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
352 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
353 | __glXClearErrorOccured(); | |||||
354 | glGetConvolutionFilter(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), | |||||
355 | *(GLenum *) (pc + 8), answer); | |||||
356 | ||||||
357 | if (__glXErrorOccured()) { | |||||
358 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
359 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
360 | } | |||||
361 | else { | |||||
362 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
363 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
364 | __GLX_SWAP_INT(&width)sw = ((GLbyte *)(&width))[0]; ((GLbyte *)(&width))[0] = ((GLbyte *)(&width))[3]; ((GLbyte *)(&width))[3] = sw; sw = ((GLbyte *)(&width))[1]; ((GLbyte *)(&width ))[1] = ((GLbyte *)(&width))[2]; ((GLbyte *)(&width)) [2] = sw;; | |||||
365 | __GLX_SWAP_INT(&height)sw = ((GLbyte *)(&height))[0]; ((GLbyte *)(&height))[ 0] = ((GLbyte *)(&height))[3]; ((GLbyte *)(&height))[ 3] = sw; sw = ((GLbyte *)(&height))[1]; ((GLbyte *)(& height))[1] = ((GLbyte *)(&height))[2]; ((GLbyte *)(& height))[2] = sw;; | |||||
366 | ((xGLXGetConvolutionFilterReply *) &__glXReply)->width = width; | |||||
367 | ((xGLXGetConvolutionFilterReply *) &__glXReply)->height = height; | |||||
368 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
369 | } | |||||
370 | ||||||
371 | return Success0; | |||||
372 | } | |||||
373 | ||||||
374 | int | |||||
375 | __glXDispSwap_GetConvolutionFilter(__GLXclientState * cl, GLbyte * pc) | |||||
376 | { | |||||
377 | const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag); | |||||
378 | ClientPtr client = cl->client; | |||||
379 | ||||||
380 | REQUEST_FIXED_SIZE(xGLXSingleReq, 16)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((16) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
381 | return GetConvolutionFilter(cl, pc + __GLX_SINGLE_HDR_SIZE8, tag); | |||||
382 | } | |||||
383 | ||||||
384 | int | |||||
385 | __glXDispSwap_GetConvolutionFilterEXT(__GLXclientState * cl, GLbyte * pc) | |||||
386 | { | |||||
387 | const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc)(((xGLXVendorPrivateReq*)pc)->contextTag); | |||||
388 | ClientPtr client = cl->client; | |||||
389 | ||||||
390 | REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16)if (((sizeof(xGLXVendorPrivateReq) >> 2) > client-> req_len) || (((16) >> 2) >= client->req_len) || ( (((uint64_t) sizeof(xGLXVendorPrivateReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
391 | return GetConvolutionFilter(cl, pc + __GLX_VENDPRIV_HDR_SIZE12, tag); | |||||
392 | } | |||||
393 | ||||||
394 | static int | |||||
395 | GetHistogram(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) | |||||
396 | { | |||||
397 | GLint compsize; | |||||
398 | GLenum format, type, target; | |||||
399 | GLboolean swapBytes, reset; | |||||
400 | __GLXcontext *cx; | |||||
401 | ClientPtr client = cl->client; | |||||
402 | int error; | |||||
403 | ||||||
404 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
405 | char *answer, answerBuffer[200]; | |||||
406 | GLint width = 0; | |||||
407 | ||||||
408 | cx = __glXForceCurrent(cl, tag, &error); | |||||
409 | if (!cx) { | |||||
410 | return error; | |||||
411 | } | |||||
412 | ||||||
413 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
414 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
415 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
416 | ||||||
417 | format = *(GLenum *) (pc + 4); | |||||
418 | type = *(GLenum *) (pc + 8); | |||||
419 | target = *(GLenum *) (pc + 0); | |||||
420 | swapBytes = *(GLboolean *) (pc + 12); | |||||
421 | reset = *(GLboolean *) (pc + 13); | |||||
422 | ||||||
423 | glGetHistogramParameteriv(target, GL_HISTOGRAM_WIDTH0x8026, &width); | |||||
424 | /* | |||||
425 | * The one query above might fail if we're in a state where queries | |||||
426 | * are illegal, but then width would still be zero anyway. | |||||
427 | */ | |||||
428 | compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); | |||||
429 | if (compsize < 0) | |||||
430 | return BadLength16; | |||||
431 | ||||||
432 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
433 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
434 | __glXClearErrorOccured(); | |||||
435 | glGetHistogram(target, reset, format, type, answer); | |||||
436 | ||||||
437 | if (__glXErrorOccured()) { | |||||
438 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
439 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
440 | } | |||||
441 | else { | |||||
442 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
443 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
444 | __GLX_SWAP_INT(&width)sw = ((GLbyte *)(&width))[0]; ((GLbyte *)(&width))[0] = ((GLbyte *)(&width))[3]; ((GLbyte *)(&width))[3] = sw; sw = ((GLbyte *)(&width))[1]; ((GLbyte *)(&width ))[1] = ((GLbyte *)(&width))[2]; ((GLbyte *)(&width)) [2] = sw;; | |||||
445 | ((xGLXGetHistogramReply *) &__glXReply)->width = width; | |||||
446 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
447 | } | |||||
448 | ||||||
449 | return Success0; | |||||
450 | } | |||||
451 | ||||||
452 | int | |||||
453 | __glXDispSwap_GetHistogram(__GLXclientState * cl, GLbyte * pc) | |||||
454 | { | |||||
455 | const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag); | |||||
456 | ClientPtr client = cl->client; | |||||
457 | ||||||
458 | REQUEST_FIXED_SIZE(xGLXSingleReq, 16)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((16) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
459 | return GetHistogram(cl, pc + __GLX_SINGLE_HDR_SIZE8, tag); | |||||
460 | } | |||||
461 | ||||||
462 | int | |||||
463 | __glXDispSwap_GetHistogramEXT(__GLXclientState * cl, GLbyte * pc) | |||||
464 | { | |||||
465 | const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc)(((xGLXVendorPrivateReq*)pc)->contextTag); | |||||
466 | ClientPtr client = cl->client; | |||||
467 | ||||||
468 | REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16)if (((sizeof(xGLXVendorPrivateReq) >> 2) > client-> req_len) || (((16) >> 2) >= client->req_len) || ( (((uint64_t) sizeof(xGLXVendorPrivateReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
469 | return GetHistogram(cl, pc + __GLX_VENDPRIV_HDR_SIZE12, tag); | |||||
470 | } | |||||
471 | ||||||
472 | static int | |||||
473 | GetMinmax(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) | |||||
474 | { | |||||
475 | GLint compsize; | |||||
476 | GLenum format, type, target; | |||||
477 | GLboolean swapBytes, reset; | |||||
478 | __GLXcontext *cx; | |||||
479 | ClientPtr client = cl->client; | |||||
480 | int error; | |||||
481 | ||||||
482 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
483 | char *answer, answerBuffer[200]; | |||||
484 | ||||||
485 | cx = __glXForceCurrent(cl, tag, &error); | |||||
486 | if (!cx) { | |||||
487 | return error; | |||||
488 | } | |||||
489 | ||||||
490 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
491 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
492 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
493 | ||||||
494 | format = *(GLenum *) (pc + 4); | |||||
495 | type = *(GLenum *) (pc + 8); | |||||
496 | target = *(GLenum *) (pc + 0); | |||||
497 | swapBytes = *(GLboolean *) (pc + 12); | |||||
498 | reset = *(GLboolean *) (pc + 13); | |||||
499 | ||||||
500 | compsize = __glGetTexImage_size(target, 1, format, type, 2, 1, 1); | |||||
501 | if (compsize < 0) | |||||
502 | return BadLength16; | |||||
503 | ||||||
504 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
505 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
506 | __glXClearErrorOccured(); | |||||
507 | glGetMinmax(target, reset, format, type, answer); | |||||
508 | ||||||
509 | if (__glXErrorOccured()) { | |||||
510 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
511 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
512 | } | |||||
513 | else { | |||||
514 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
515 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
516 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
517 | } | |||||
518 | ||||||
519 | return Success0; | |||||
520 | } | |||||
521 | ||||||
522 | int | |||||
523 | __glXDispSwap_GetMinmax(__GLXclientState * cl, GLbyte * pc) | |||||
524 | { | |||||
525 | const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag); | |||||
526 | ClientPtr client = cl->client; | |||||
527 | ||||||
528 | REQUEST_FIXED_SIZE(xGLXSingleReq, 16)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((16) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
529 | return GetMinmax(cl, pc + __GLX_SINGLE_HDR_SIZE8, tag); | |||||
530 | } | |||||
531 | ||||||
532 | int | |||||
533 | __glXDispSwap_GetMinmaxEXT(__GLXclientState * cl, GLbyte * pc) | |||||
534 | { | |||||
535 | const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc)(((xGLXVendorPrivateReq*)pc)->contextTag); | |||||
536 | ClientPtr client = cl->client; | |||||
537 | ||||||
538 | REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16)if (((sizeof(xGLXVendorPrivateReq) >> 2) > client-> req_len) || (((16) >> 2) >= client->req_len) || ( (((uint64_t) sizeof(xGLXVendorPrivateReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
539 | return GetMinmax(cl, pc + __GLX_VENDPRIV_HDR_SIZE12, tag); | |||||
540 | } | |||||
541 | ||||||
542 | static int | |||||
543 | GetColorTable(__GLXclientState * cl, GLbyte * pc, GLXContextTag tag) | |||||
544 | { | |||||
545 | GLint compsize; | |||||
546 | GLenum format, type, target; | |||||
547 | GLboolean swapBytes; | |||||
548 | __GLXcontext *cx; | |||||
549 | ClientPtr client = cl->client; | |||||
550 | int error; | |||||
551 | ||||||
552 | __GLX_DECLARE_SWAP_VARIABLESGLbyte sw; | |||||
553 | char *answer, answerBuffer[200]; | |||||
554 | GLint width = 0; | |||||
555 | ||||||
556 | cx = __glXForceCurrent(cl, tag, &error); | |||||
557 | if (!cx) { | |||||
558 | return error; | |||||
559 | } | |||||
560 | ||||||
561 | __GLX_SWAP_INT(pc + 0)sw = ((GLbyte *)(pc + 0))[0]; ((GLbyte *)(pc + 0))[0] = ((GLbyte *)(pc + 0))[3]; ((GLbyte *)(pc + 0))[3] = sw; sw = ((GLbyte * )(pc + 0))[1]; ((GLbyte *)(pc + 0))[1] = ((GLbyte *)(pc + 0)) [2]; ((GLbyte *)(pc + 0))[2] = sw;; | |||||
562 | __GLX_SWAP_INT(pc + 4)sw = ((GLbyte *)(pc + 4))[0]; ((GLbyte *)(pc + 4))[0] = ((GLbyte *)(pc + 4))[3]; ((GLbyte *)(pc + 4))[3] = sw; sw = ((GLbyte * )(pc + 4))[1]; ((GLbyte *)(pc + 4))[1] = ((GLbyte *)(pc + 4)) [2]; ((GLbyte *)(pc + 4))[2] = sw;; | |||||
563 | __GLX_SWAP_INT(pc + 8)sw = ((GLbyte *)(pc + 8))[0]; ((GLbyte *)(pc + 8))[0] = ((GLbyte *)(pc + 8))[3]; ((GLbyte *)(pc + 8))[3] = sw; sw = ((GLbyte * )(pc + 8))[1]; ((GLbyte *)(pc + 8))[1] = ((GLbyte *)(pc + 8)) [2]; ((GLbyte *)(pc + 8))[2] = sw;; | |||||
564 | ||||||
565 | format = *(GLenum *) (pc + 4); | |||||
566 | type = *(GLenum *) (pc + 8); | |||||
567 | target = *(GLenum *) (pc + 0); | |||||
568 | swapBytes = *(GLboolean *) (pc + 12); | |||||
569 | ||||||
570 | glGetColorTableParameteriv(target, GL_COLOR_TABLE_WIDTH0x80D9, &width); | |||||
571 | /* | |||||
572 | * The one query above might fail if we're in a state where queries | |||||
573 | * are illegal, but then width would still be zero anyway. | |||||
574 | */ | |||||
575 | compsize = __glGetTexImage_size(target, 1, format, type, width, 1, 1); | |||||
576 | if (compsize < 0) | |||||
577 | return BadLength16; | |||||
578 | ||||||
579 | glPixelStorei(GL_PACK_SWAP_BYTES0x0D00, !swapBytes); | |||||
580 | __GLX_GET_ANSWER_BUFFER(answer, cl, compsize, 1)if (compsize < 0) return 16; else if ((compsize) > sizeof (answerBuffer)) { int bump; if ((cl)->returnBufSize < ( compsize)+(1)) { (cl)->returnBuf = (GLbyte*)realloc((cl)-> returnBuf, (compsize)+(1)); if (!(cl)->returnBuf) { return 11; } (cl)->returnBufSize = (compsize)+(1); } answer = (char *)cl->returnBuf; bump = (long)(answer) % (1); if (bump) answer += (1) - (bump); } else { answer = (char *)answerBuffer; }; | |||||
581 | __glXClearErrorOccured(); | |||||
582 | glGetColorTable(*(GLenum *) (pc + 0), *(GLenum *) (pc + 4), | |||||
583 | *(GLenum *) (pc + 8), answer); | |||||
584 | ||||||
585 | if (__glXErrorOccured()) { | |||||
586 | __GLX_BEGIN_REPLY(0)__glXReply.length = (((0)+3) & (GLuint)~3) >> 2; __glXReply .type = 1; __glXReply.sequenceNumber = client->sequence;; | |||||
587 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
588 | } | |||||
589 | else { | |||||
590 | __GLX_BEGIN_REPLY(compsize)__glXReply.length = (((compsize)+3) & (GLuint)~3) >> 2; __glXReply.type = 1; __glXReply.sequenceNumber = client-> sequence;; | |||||
591 | __GLX_SWAP_REPLY_HEADER()sw = ((GLbyte *)(&__glXReply.sequenceNumber))[0]; ((GLbyte *)(&__glXReply.sequenceNumber))[0] = ((GLbyte *)(&__glXReply .sequenceNumber))[1]; ((GLbyte *)(&__glXReply.sequenceNumber ))[1] = sw;; sw = ((GLbyte *)(&__glXReply.length))[0]; (( GLbyte *)(&__glXReply.length))[0] = ((GLbyte *)(&__glXReply .length))[3]; ((GLbyte *)(&__glXReply.length))[3] = sw; sw = ((GLbyte *)(&__glXReply.length))[1]; ((GLbyte *)(& __glXReply.length))[1] = ((GLbyte *)(&__glXReply.length)) [2]; ((GLbyte *)(&__glXReply.length))[2] = sw;;; | |||||
592 | __GLX_SWAP_INT(&width)sw = ((GLbyte *)(&width))[0]; ((GLbyte *)(&width))[0] = ((GLbyte *)(&width))[3]; ((GLbyte *)(&width))[3] = sw; sw = ((GLbyte *)(&width))[1]; ((GLbyte *)(&width ))[1] = ((GLbyte *)(&width))[2]; ((GLbyte *)(&width)) [2] = sw;; | |||||
593 | ((xGLXGetColorTableReply *) &__glXReply)->width = width; | |||||
594 | __GLX_SEND_VOID_ARRAY(compsize)WriteToClient(client, ((((compsize)*1)+3) & (GLuint)~3), answer ); | |||||
595 | } | |||||
596 | ||||||
597 | return Success0; | |||||
598 | } | |||||
599 | ||||||
600 | int | |||||
601 | __glXDispSwap_GetColorTable(__GLXclientState * cl, GLbyte * pc) | |||||
602 | { | |||||
603 | const GLXContextTag tag = __GLX_GET_SINGLE_CONTEXT_TAG(pc)(((xGLXSingleReq*)pc)->contextTag); | |||||
604 | ClientPtr client = cl->client; | |||||
605 | ||||||
606 | REQUEST_FIXED_SIZE(xGLXSingleReq, 16)if (((sizeof(xGLXSingleReq) >> 2) > client->req_len ) || (((16) >> 2) >= client->req_len) || ((((uint64_t ) sizeof(xGLXSingleReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
607 | return GetColorTable(cl, pc + __GLX_SINGLE_HDR_SIZE8, tag); | |||||
608 | } | |||||
609 | ||||||
610 | int | |||||
611 | __glXDispSwap_GetColorTableSGI(__GLXclientState * cl, GLbyte * pc) | |||||
612 | { | |||||
613 | const GLXContextTag tag = __GLX_GET_VENDPRIV_CONTEXT_TAG(pc)(((xGLXVendorPrivateReq*)pc)->contextTag); | |||||
614 | ClientPtr client = cl->client; | |||||
615 | ||||||
616 | REQUEST_FIXED_SIZE(xGLXVendorPrivateReq, 16)if (((sizeof(xGLXVendorPrivateReq) >> 2) > client-> req_len) || (((16) >> 2) >= client->req_len) || ( (((uint64_t) sizeof(xGLXVendorPrivateReq) + (16) + 3) >> 2) != (uint64_t) client->req_len)) return(16); | |||||
617 | return GetColorTable(cl, pc + __GLX_VENDPRIV_HDR_SIZE12, tag); | |||||
618 | } |