summaryrefslogtreecommitdiff
path: root/glx
diff options
context:
space:
mode:
authorJamey Sharp <jamey@minilop.net>2009-10-08 13:36:44 +1100
committerDaniel Stone <daniel@fooishbar.org>2009-10-08 13:36:44 +1100
commit9bf2ff4faf730913de3073f346646a8727be41d4 (patch)
treed1ab787c05589b0c09e0ff6c184a2555966793d8 /glx
parentb422b532f3dcab54c53f61a66f2ad76059d1874a (diff)
Fix "possibly uninitialized" warnings in glx
In both functions, "answer" was uninitialized if "compsize" was 0, but in that case __GLX_SEND_VOID_ARRAY(compsize) results in a call to WriteToClient for 0 bytes, which returns immediately without examining the "answer" argument. So initializing to a null pointer is as good as anything else. Signed-off-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'glx')
-rw-r--r--glx/indirect_texture_compression.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/glx/indirect_texture_compression.c b/glx/indirect_texture_compression.c
index 25c6eb30e..5f44d7b1a 100644
--- a/glx/indirect_texture_compression.c
+++ b/glx/indirect_texture_compression.c
@@ -52,7 +52,7 @@ int __glXDisp_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyte *p
const GLenum target = *(GLenum *)(pc + 0);
const GLint level = *(GLint *)(pc + 4);
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));
@@ -92,7 +92,7 @@ int __glXDispSwap_GetCompressedTexImageARB(struct __GLXclientStateRec *cl, GLbyt
const GLenum target = (GLenum) bswap_32( *(int *)(pc + 0) );
const GLint level = (GLint ) bswap_32( *(int *)(pc + 4) );
GLint compsize = 0;
- char *answer, answerBuffer[200];
+ char *answer = NULL, answerBuffer[200];
CALL_GetTexLevelParameteriv(GET_DISPATCH(), (target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE, &compsize));