and add assertions to prevent buffer overflow. This fixes corruption
of the r600_shader struct.
NOTE: This is a candidate for the stable branches.
switch (d->Declaration.File) {
case TGSI_FILE_INPUT:
i = ctx->shader->ninput;
+ assert(i < Elements(ctx->shader->input));
ctx->shader->ninput += count;
ctx->shader->input[i].name = d->Semantic.Name;
ctx->shader->input[i].sid = d->Semantic.Index;
break;
case TGSI_FILE_OUTPUT:
i = ctx->shader->noutput++;
+ assert(i < Elements(ctx->shader->output));
ctx->shader->output[i].name = d->Semantic.Name;
ctx->shader->output[i].sid = d->Semantic.Index;
ctx->shader->output[i].gpr = ctx->file_offset[TGSI_FILE_OUTPUT] + d->Range.First;
unsigned ninput;
unsigned noutput;
unsigned nlds;
- struct r600_shader_io input[32];
- struct r600_shader_io output[32];
+ struct r600_shader_io input[40];
+ struct r600_shader_io output[40];
boolean uses_kill;
boolean fs_write_all;
boolean two_side;