/[gentoo-x86]/x11-base/xorg-server/files/1.0.2-dbe-render.diff
Gentoo

Contents of /x11-base/xorg-server/files/1.0.2-dbe-render.diff

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Jan 24 06:34:22 2007 UTC (7 years, 10 months ago) by dberkholz
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
File MIME type: text/plain
FILE REMOVED
Stop supporting Xorg 7.0.
(Portage version: 2.1.2)
 (Unsigned Manifest commit)

1 --- dbe/dbe.c.old 2007-01-07 09:56:29.000000000 -0700
2 +++ dbe/dbe.c 2007-01-07 10:00:13.000000000 -0700
3 @@ -41,6 +41,12 @@
4 #include <dix-config.h>
5 #endif
6
7 +#if HAVE_STDINT_T
8 +#include <stdint.h>
9 +#elif !defined(UINT32_MAX)
10 +#define UINT32_MAX 0xffffffffU
11 +#endif
12 +
13 #include <X11/X.h>
14 #include <X11/Xproto.h>
15 #include "scrnintstr.h"
16 @@ -733,11 +739,14 @@ ProcDbeSwapBuffers(client)
17 return(Success);
18 }
19
20 + if (nStuff > UINT32_MAX / sizeof(DbeSwapInfoRec))
21 + return BadAlloc;
22 +
23 /* Get to the swap info appended to the end of the request. */
24 dbeSwapInfo = (xDbeSwapInfo *)&stuff[1];
25
26 /* Allocate array to record swap information. */
27 - swapInfo = (DbeSwapInfoPtr)ALLOCATE_LOCAL(nStuff * sizeof(DbeSwapInfoRec));
28 + swapInfo = (DbeSwapInfoPtr)Xalloc(nStuff * sizeof(DbeSwapInfoRec));
29 if (swapInfo == NULL)
30 {
31 return(BadAlloc);
32 @@ -752,14 +761,14 @@ ProcDbeSwapBuffers(client)
33 if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client,
34 SecurityWriteAccess)))
35 {
36 - DEALLOCATE_LOCAL(swapInfo);
37 + Xfree(swapInfo);
38 return(BadWindow);
39 }
40
41 /* Each window must be double-buffered - BadMatch. */
42 if (DBE_WINDOW_PRIV(pWin) == NULL)
43 {
44 - DEALLOCATE_LOCAL(swapInfo);
45 + Xfree(swapInfo);
46 return(BadMatch);
47 }
48
49 @@ -768,7 +777,7 @@ ProcDbeSwapBuffers(client)
50 {
51 if (dbeSwapInfo[i].window == dbeSwapInfo[j].window)
52 {
53 - DEALLOCATE_LOCAL(swapInfo);
54 + Xfree(swapInfo);
55 return(BadMatch);
56 }
57 }
58 @@ -779,7 +788,7 @@ ProcDbeSwapBuffers(client)
59 (dbeSwapInfo[i].swapAction != XdbeUntouched ) &&
60 (dbeSwapInfo[i].swapAction != XdbeCopied ))
61 {
62 - DEALLOCATE_LOCAL(swapInfo);
63 + Xfree(swapInfo);
64 return(BadValue);
65 }
66
67 @@ -809,12 +818,12 @@ ProcDbeSwapBuffers(client)
68 error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo);
69 if (error != Success)
70 {
71 - DEALLOCATE_LOCAL(swapInfo);
72 + Xfree(swapInfo);
73 return(error);
74 }
75 }
76
77 - DEALLOCATE_LOCAL(swapInfo);
78 + Xfree(swapInfo);
79 return(Success);
80
81 } /* ProcDbeSwapBuffers() */
82 @@ -898,10 +907,12 @@ ProcDbeGetVisualInfo(client)
83
84 REQUEST_AT_LEAST_SIZE(xDbeGetVisualInfoReq);
85
86 + if (stuff->n > UINT32_MAX / sizeof(DrawablePtr))
87 + return BadAlloc;
88 /* Make sure any specified drawables are valid. */
89 if (stuff->n != 0)
90 {
91 - if (!(pDrawables = (DrawablePtr *)ALLOCATE_LOCAL(stuff->n *
92 + if (!(pDrawables = (DrawablePtr *)Xalloc(stuff->n *
93 sizeof(DrawablePtr))))
94 {
95 return(BadAlloc);
96 @@ -914,7 +925,7 @@ ProcDbeGetVisualInfo(client)
97 if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable(
98 drawables[i], client, SecurityReadAccess)))
99 {
100 - DEALLOCATE_LOCAL(pDrawables);
101 + Xfree(pDrawables);
102 return(BadDrawable);
103 }
104 }
105 @@ -926,7 +937,7 @@ ProcDbeGetVisualInfo(client)
106 {
107 if (pDrawables)
108 {
109 - DEALLOCATE_LOCAL(pDrawables);
110 + Xfree(pDrawables);
111 }
112
113 return(BadAlloc);
114 @@ -953,7 +964,7 @@ ProcDbeGetVisualInfo(client)
115 /* Free pDrawables if we needed to allocate it above. */
116 if (pDrawables)
117 {
118 - DEALLOCATE_LOCAL(pDrawables);
119 + Xfree(pDrawables);
120 }
121
122 return(BadAlloc);
123 @@ -1034,7 +1045,7 @@ ProcDbeGetVisualInfo(client)
124
125 if (pDrawables)
126 {
127 - DEALLOCATE_LOCAL(pDrawables);
128 + Xfree(pDrawables);
129 }
130
131 return(client->noClientException);
132 --- render/render.c.old 2007-01-07 09:56:46.000000000 -0700
133 +++ render/render.c 2007-01-07 09:58:10.000000000 -0700
134 @@ -52,6 +52,12 @@
135 #include "xf86_ansic.h"
136 #endif
137
138 +#if HAVE_STDINT_H
139 +#include <stdint.h>
140 +#elif !defined(UINT32_MAX)
141 +#define UINT32_MAX 0xffffffffU
142 +#endif
143 +
144 static int ProcRenderQueryVersion (ClientPtr pClient);
145 static int ProcRenderQueryPictFormats (ClientPtr pClient);
146 static int ProcRenderQueryPictIndexValues (ClientPtr pClient);
147 @@ -1108,11 +1114,14 @@ ProcRenderAddGlyphs (ClientPtr client)
148 }
149
150 nglyphs = stuff->nglyphs;
151 + if (nglyphs > UINT32_MAX / sizeof(GlyphNewRec))
152 + return BadAlloc;
153 +
154 if (nglyphs <= NLOCALGLYPH)
155 glyphsBase = glyphsLocal;
156 else
157 {
158 - glyphsBase = (GlyphNewPtr) ALLOCATE_LOCAL (nglyphs * sizeof (GlyphNewRec));
159 + glyphsBase = (GlyphNewPtr) Xalloc (nglyphs * sizeof (GlyphNewRec));
160 if (!glyphsBase)
161 return BadAlloc;
162 }
163 @@ -1169,7 +1178,7 @@ ProcRenderAddGlyphs (ClientPtr client)
164 }
165
166 if (glyphsBase != glyphsLocal)
167 - DEALLOCATE_LOCAL (glyphsBase);
168 + Xfree (glyphsBase);
169 return client->noClientException;
170 bail:
171 while (glyphs != glyphsBase)
172 @@ -1178,7 +1187,7 @@ bail:
173 xfree (glyphs->glyph);
174 }
175 if (glyphsBase != glyphsLocal)
176 - DEALLOCATE_LOCAL (glyphsBase);
177 + Xfree (glyphsBase);
178 return err;
179 }
180

  ViewVC Help
Powered by ViewVC 1.1.20