Skip to content
Commit 47f1f4f9 authored by Kenneth Graunke's avatar Kenneth Graunke Committed by Juan A. Suarez Romero
Browse files

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: 6d830940 glsl/shader_cache: Allow shader cache usage with transform feedback

Reviewed-by: default avatarTimothy Arceri <tarceri@itsqueeze.com>
(cherry picked from commit 3c10a272)
parent db4850c6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment