diff options
author | Kenneth Graunke <[email protected]> | 2019-06-07 23:00:40 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2019-06-17 21:22:19 -0500 |
commit | 3c10a2726bcf686f03e31e79e40786e3894ff063 (patch) | |
tree | f0ead33ac3c5ffc06edc0583c76ccffa7aa4fa00 /src/compiler/glsl/ir_expression_flattening.h | |
parent | 9672b7044cc329b94a72de9ec5bdda1895901304 (diff) |
glsl: Fix out of bounds read in shader_cache_read_program_metadata
The VaryingNames array has NumVaryings entries. But BufferStride is
a small array of MAX_FEEDBACK_BUFFERS (4) entries. Programs with
more than 4 varyings would read out of bounds.
Also, BufferStride is set based on the shader itself, which means that
it's inherently already included in the hash, and doesn't need to be
included again. At the point when shader_cache_read_program_metadata
is called, the linker hasn't even set those fields yet. So, just drop
it entirely.
Fixes valgrind errors in KHR-GL45.transform_feedback.linking_errors_test.
Fixes: 6d830940f78 glsl/shader_cache: Allow shader cache usage with transform feedback
Reviewed-by: Timothy Arceri <[email protected]>
Diffstat (limited to 'src/compiler/glsl/ir_expression_flattening.h')
0 files changed, 0 insertions, 0 deletions