aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/glx')
-rw-r--r--xorg-server/glx/indirect_dispatch.c25
-rw-r--r--xorg-server/glx/indirect_dispatch_swap.c26
2 files changed, 51 insertions, 0 deletions
diff --git a/xorg-server/glx/indirect_dispatch.c b/xorg-server/glx/indirect_dispatch.c
index 329b2e61e..f6cabefc8 100644
--- a/xorg-server/glx/indirect_dispatch.c
+++ b/xorg-server/glx/indirect_dispatch.c
@@ -2464,6 +2464,9 @@ __glXDisp_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
GLboolean answerBuffer[200];
GLboolean *residences =
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
+
+ if (residences == NULL)
+ return BadAlloc;
retval =
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
@@ -2488,6 +2491,9 @@ __glXDisp_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
GLboolean answerBuffer[200];
GLboolean *residences =
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
+
+ if (residences == NULL)
+ return BadAlloc;
retval =
glAreTexturesResident(n, (const GLuint *) (pc + 4), residences);
__glXSendReply(cl->client, residences, n, 1, GL_TRUE, retval);
@@ -2593,6 +2599,9 @@ __glXDisp_GenTextures(__GLXclientState * cl, GLbyte * pc)
GLuint *textures =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (textures == NULL)
+ return BadAlloc;
glGenTextures(n, textures);
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
error = Success;
@@ -2616,6 +2625,9 @@ __glXDisp_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
GLuint *textures =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (textures == NULL)
+ return BadAlloc;
glGenTextures(n, textures);
__glXSendReply(cl->client, textures, n, 4, GL_TRUE, 0);
error = Success;
@@ -3883,6 +3895,9 @@ __glXDisp_GenQueries(__GLXclientState * cl, GLbyte * pc)
GLuint *ids =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (ids == NULL)
+ return BadAlloc;
GenQueries(n, ids);
__glXSendReply(cl->client, ids, n, 4, GL_TRUE, 0);
error = Success;
@@ -4253,6 +4268,9 @@ __glXDisp_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
GLuint *programs =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (programs == NULL)
+ return BadAlloc;
GenProgramsARB(n, programs);
__glXSendReply(cl->client, programs, n, 4, GL_TRUE, 0);
error = Success;
@@ -4630,6 +4648,10 @@ __glXDisp_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
GLuint *framebuffers =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (framebuffers == NULL)
+ return BadAlloc;
+
GenFramebuffers(n, framebuffers);
__glXSendReply(cl->client, framebuffers, n, 4, GL_TRUE, 0);
error = Success;
@@ -4655,6 +4677,9 @@ __glXDisp_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
GLuint *renderbuffers =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (renderbuffers == NULL)
+ return BadAlloc;
GenRenderbuffers(n, renderbuffers);
__glXSendReply(cl->client, renderbuffers, n, 4, GL_TRUE, 0);
error = Success;
diff --git a/xorg-server/glx/indirect_dispatch_swap.c b/xorg-server/glx/indirect_dispatch_swap.c
index 647d0c985..c0bb64d5d 100644
--- a/xorg-server/glx/indirect_dispatch_swap.c
+++ b/xorg-server/glx/indirect_dispatch_swap.c
@@ -2731,6 +2731,9 @@ __glXDispSwap_AreTexturesResident(__GLXclientState * cl, GLbyte * pc)
GLboolean answerBuffer[200];
GLboolean *residences =
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
+
+ if (residences == NULL)
+ return BadAlloc;
retval =
glAreTexturesResident(n,
(const GLuint *)
@@ -2759,6 +2762,9 @@ __glXDispSwap_AreTexturesResidentEXT(__GLXclientState * cl, GLbyte * pc)
GLboolean answerBuffer[200];
GLboolean *residences =
__glXGetAnswerBuffer(cl, n, answerBuffer, sizeof(answerBuffer), 1);
+
+ if (residences == NULL)
+ return BadAlloc;
retval =
glAreTexturesResident(n,
(const GLuint *)
@@ -2878,6 +2884,9 @@ __glXDispSwap_GenTextures(__GLXclientState * cl, GLbyte * pc)
GLuint *textures =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (textures == NULL)
+ return BadAlloc;
glGenTextures(n, textures);
(void) bswap_32_array((uint32_t *) textures, n);
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
@@ -2903,6 +2912,9 @@ __glXDispSwap_GenTexturesEXT(__GLXclientState * cl, GLbyte * pc)
GLuint *textures =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (textures == NULL)
+ return BadAlloc;
glGenTextures(n, textures);
(void) bswap_32_array((uint32_t *) textures, n);
__glXSendReplySwap(cl->client, textures, n, 4, GL_TRUE, 0);
@@ -4290,6 +4302,9 @@ __glXDispSwap_GenQueries(__GLXclientState * cl, GLbyte * pc)
GLuint *ids =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+ if (ids == NULL)
+ return BadAlloc;
+
GenQueries(n, ids);
(void) bswap_32_array((uint32_t *) ids, n);
__glXSendReplySwap(cl->client, ids, n, 4, GL_TRUE, 0);
@@ -4697,6 +4712,9 @@ __glXDispSwap_GenProgramsARB(__GLXclientState * cl, GLbyte * pc)
GLuint *programs =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+ if (programs == NULL)
+ return BadAlloc;
+
GenProgramsARB(n, programs);
(void) bswap_32_array((uint32_t *) programs, n);
__glXSendReplySwap(cl->client, programs, n, 4, GL_TRUE, 0);
@@ -5122,6 +5140,10 @@ __glXDispSwap_GenFramebuffers(__GLXclientState * cl, GLbyte * pc)
GLuint *framebuffers =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (framebuffers == NULL)
+ return BadAlloc;
+
GenFramebuffers(n, framebuffers);
(void) bswap_32_array((uint32_t *) framebuffers, n);
__glXSendReplySwap(cl->client, framebuffers, n, 4, GL_TRUE, 0);
@@ -5149,6 +5171,10 @@ __glXDispSwap_GenRenderbuffers(__GLXclientState * cl, GLbyte * pc)
GLuint *renderbuffers =
__glXGetAnswerBuffer(cl, n * 4, answerBuffer, sizeof(answerBuffer),
4);
+
+ if (renderbuffers == NULL)
+ return BadAlloc;
+
GenRenderbuffers(n, renderbuffers);
(void) bswap_32_array((uint32_t *) renderbuffers, n);
__glXSendReplySwap(cl->client, renderbuffers, n, 4, GL_TRUE, 0);