diff options
-rw-r--r-- | src/vrend_renderer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index fcd79c5..c8e5b60 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -3412,6 +3412,12 @@ void vrend_bind_sampler_states(struct vrend_context *ctx, return; } + if (num_states > PIPE_MAX_SAMPLERS || + start_slot > (PIPE_MAX_SAMPLERS - num_states)) { + report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_CMD_BUFFER, num_states); + return; + } + ctx->sub->num_sampler_states[shader_type] = num_states; for (i = 0; i < num_states; i++) { |