mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-06-06 07:20:48 +00:00
Fixed warning C26052: Potentially unconstrained access using expression '(signed char *)info'
This commit is contained in:
parent
6ee34380f4
commit
a28769759b
1 changed files with 2 additions and 3 deletions
|
@ -543,20 +543,19 @@ static GLuint GLES2_CacheShader(GLES2_RenderData *data, GLES2_ShaderType type, G
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!compileSuccessful) {
|
if (!compileSuccessful) {
|
||||||
SDL_bool isstack = SDL_FALSE;
|
|
||||||
char *info = NULL;
|
char *info = NULL;
|
||||||
int length = 0;
|
int length = 0;
|
||||||
|
|
||||||
data->glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length);
|
data->glGetShaderiv(id, GL_INFO_LOG_LENGTH, &length);
|
||||||
if (length > 0) {
|
if (length > 0) {
|
||||||
info = SDL_small_alloc(char, length, &isstack);
|
info = (char *)SDL_malloc(length);
|
||||||
if (info) {
|
if (info) {
|
||||||
data->glGetShaderInfoLog(id, length, &length, info);
|
data->glGetShaderInfoLog(id, length, &length, info);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (info) {
|
if (info) {
|
||||||
SDL_SetError("Failed to load the shader %d: %s", type, info);
|
SDL_SetError("Failed to load the shader %d: %s", type, info);
|
||||||
SDL_small_free(info, isstack);
|
SDL_free(info);
|
||||||
} else {
|
} else {
|
||||||
SDL_SetError("Failed to load the shader %d", type);
|
SDL_SetError("Failed to load the shader %d", type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue