summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2015-03-21 15:05:30 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2015-04-21 16:58:08 -0700
commitf59236c2865d22c6f0b2d1ba303213afd10cd02e (patch)
tree86865f9806a3754895861910a8a27c1d93bb5653 /glx
parent7ac280287491fe06127d9fefc504217e21c780e6 (diff)
Convert glamor & glx to new *allocarray functions
v2: fixup whitespace Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Matt Turner <mattst88@gmail.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'glx')
-rw-r--r--glx/single2.c9
-rw-r--r--glx/single2swap.c9
2 files changed, 8 insertions, 10 deletions
diff --git a/glx/single2.c b/glx/single2.c
index a6ea614fd..acc66ac07 100644
--- a/glx/single2.c
+++ b/glx/single2.c
@@ -62,9 +62,8 @@ __glXDisp_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
size = *(GLsizei *) (pc + 0);
type = *(GLenum *) (pc + 4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
- (size_t) size
- * __GLX_SIZE_FLOAT32);
+ cx->feedbackBuf = reallocarray(cx->feedbackBuf,
+ (size_t) size, __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
@@ -94,8 +93,8 @@ __glXDisp_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
pc += __GLX_SINGLE_HDR_SIZE;
size = *(GLsizei *) (pc + 0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
- (size_t) size * __GLX_SIZE_CARD32);
+ cx->selectBuf = reallocarray(cx->selectBuf,
+ (size_t) size, __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;
diff --git a/glx/single2swap.c b/glx/single2swap.c
index 53490694b..d5bb1c03c 100644
--- a/glx/single2swap.c
+++ b/glx/single2swap.c
@@ -63,9 +63,8 @@ __glXDispSwap_FeedbackBuffer(__GLXclientState * cl, GLbyte * pc)
size = *(GLsizei *) (pc + 0);
type = *(GLenum *) (pc + 4);
if (cx->feedbackBufSize < size) {
- cx->feedbackBuf = (GLfloat *) realloc(cx->feedbackBuf,
- (size_t) size
- * __GLX_SIZE_FLOAT32);
+ cx->feedbackBuf = reallocarray(cx->feedbackBuf,
+ (size_t) size, __GLX_SIZE_FLOAT32);
if (!cx->feedbackBuf) {
cl->client->errorValue = size;
return BadAlloc;
@@ -99,8 +98,8 @@ __glXDispSwap_SelectBuffer(__GLXclientState * cl, GLbyte * pc)
__GLX_SWAP_INT(pc + 0);
size = *(GLsizei *) (pc + 0);
if (cx->selectBufSize < size) {
- cx->selectBuf = (GLuint *) realloc(cx->selectBuf,
- (size_t) size * __GLX_SIZE_CARD32);
+ cx->selectBuf = reallocarray(cx->selectBuf,
+ (size_t) size, __GLX_SIZE_CARD32);
if (!cx->selectBuf) {
cl->client->errorValue = size;
return BadAlloc;