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>
This commit is contained in:
parent
b422b532f3
commit
9bf2ff4faf
@ -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));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user