diff options
author | Jamey Sharp <jamey@minilop.net> | 2009-10-08 13:36:44 +1100 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-10-08 13:36:44 +1100 |
commit | 9bf2ff4faf730913de3073f346646a8727be41d4 (patch) | |
tree | d1ab787c05589b0c09e0ff6c184a2555966793d8 /glx | |
parent | b422b532f3dcab54c53f61a66f2ad76059d1874a (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.c | 4 |
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)); |