Commit 36492a40 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Dave Airlie

decode: validate shader type

Fix found thanks to american fuzzy lop.
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent ad4f0f19
......@@ -219,6 +219,10 @@ static int vrend_decode_set_constant_buffer(struct vrend_decode_ctx *ctx, uint16
shader = get_buf_entry(ctx, VIRGL_SET_CONSTANT_BUFFER_SHADER_TYPE);
index = get_buf_entry(ctx, VIRGL_SET_CONSTANT_BUFFER_INDEX);
if (shader >= PIPE_SHADER_TYPES)
return EINVAL;
vrend_set_constants(ctx->grctx, shader, index, nc, get_buf_ptr(ctx, VIRGL_SET_CONSTANT_BUFFER_DATA_START));
return 0;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment