mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-18 22:00:25 +01:00
intel/batch_decoder: catch invalid sampler state pointer
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9707>
This commit is contained in:
parent
31178db610
commit
bb8ee5f52d
1 changed files with 9 additions and 2 deletions
|
|
@ -350,11 +350,18 @@ dump_samplers(struct intel_batch_decode_ctx *ctx, uint32_t offset, int count)
|
|||
return;
|
||||
}
|
||||
|
||||
const unsigned sampler_state_size = strct->dw_length * 4;
|
||||
|
||||
if (count * sampler_state_size >= bo.size) {
|
||||
fprintf(ctx->fp, " sampler state ends after bo ends\n");
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
fprintf(ctx->fp, "sampler state %d\n", i);
|
||||
ctx_print_group(ctx, strct, state_addr, state_map);
|
||||
state_addr += 16;
|
||||
state_map += 16;
|
||||
state_addr += sampler_state_size;
|
||||
state_map += sampler_state_size;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue