Skip to content

Commit

Permalink
Merge pull request #84741 from lawnjelly/bogus_shader_log
Browse files Browse the repository at this point in the history
[GLES3] Protect against bogus `glGetShaderInfoLog` return values.
  • Loading branch information
akien-mga committed Nov 12, 2023
2 parents 747bff0 + 593cdf0 commit ef2cc1c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/gles3/shader_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ void ShaderGLES3::_compile_specialization(Version::Specialization &spec, uint32_
}

char *ilogmem = (char *)Memory::alloc_static(iloglen + 1);
ilogmem[iloglen] = '\0';
memset(ilogmem, 0, iloglen + 1);
glGetShaderInfoLog(spec.vert_id, iloglen, &iloglen, ilogmem);

String err_string = name + ": Vertex shader compilation failed:\n";
Expand Down Expand Up @@ -376,7 +376,7 @@ void ShaderGLES3::_compile_specialization(Version::Specialization &spec, uint32_
}

char *ilogmem = (char *)Memory::alloc_static(iloglen + 1);
ilogmem[iloglen] = '\0';
memset(ilogmem, 0, iloglen + 1);
glGetShaderInfoLog(spec.frag_id, iloglen, &iloglen, ilogmem);

String err_string = name + ": Fragment shader compilation failed:\n";
Expand Down

0 comments on commit ef2cc1c

Please sign in to comment.