mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01:00
glsl/linker: report linker errors for invalid explicit locations on inputs
We were assuming that if an input has an invalid explicit location it would fail to link because it would not find the corresponding output, however, since we look for the matching output by indexing the explicit_locations array with the input location, we still need to ensure that we don't index out of bounds. Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
This commit is contained in:
parent
16cfbef44c
commit
b944617224
1 changed files with 7 additions and 0 deletions
|
|
@ -556,6 +556,13 @@ cross_validate_outputs_to_inputs(struct gl_context *ctx,
|
|||
unsigned slot_limit = idx + num_elements;
|
||||
|
||||
while (idx < slot_limit) {
|
||||
if (idx >= MAX_VARYING) {
|
||||
linker_error(prog,
|
||||
"Invalid location %u in %s shader\n", idx,
|
||||
_mesa_shader_stage_to_string(consumer->Stage));
|
||||
return;
|
||||
}
|
||||
|
||||
output = explicit_locations[idx][input->data.location_frac];
|
||||
|
||||
if (output == NULL ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue