|
|
@ -73,7 +73,7 @@ static int vrend_decode_create_shader(struct vrend_decode_ctx *ctx, |
|
|
|
uint8_t *shd_text; |
|
|
|
uint8_t *shd_text; |
|
|
|
uint32_t type; |
|
|
|
uint32_t type; |
|
|
|
|
|
|
|
|
|
|
|
if (length < 5) |
|
|
|
if (length < VIRGL_OBJ_SHADER_HDR_SIZE(0)) |
|
|
|
return EINVAL; |
|
|
|
return EINVAL; |
|
|
|
|
|
|
|
|
|
|
|
type = get_buf_entry(ctx, VIRGL_OBJ_SHADER_TYPE); |
|
|
|
type = get_buf_entry(ctx, VIRGL_OBJ_SHADER_TYPE); |
|
|
@ -81,6 +81,8 @@ static int vrend_decode_create_shader(struct vrend_decode_ctx *ctx, |
|
|
|
offlen = get_buf_entry(ctx, VIRGL_OBJ_SHADER_OFFSET); |
|
|
|
offlen = get_buf_entry(ctx, VIRGL_OBJ_SHADER_OFFSET); |
|
|
|
num_so_outputs = get_buf_entry(ctx, VIRGL_OBJ_SHADER_SO_NUM_OUTPUTS); |
|
|
|
num_so_outputs = get_buf_entry(ctx, VIRGL_OBJ_SHADER_SO_NUM_OUTPUTS); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (length < VIRGL_OBJ_SHADER_HDR_SIZE(num_so_outputs)) |
|
|
|
|
|
|
|
return EINVAL; |
|
|
|
if (num_so_outputs > PIPE_MAX_SO_OUTPUTS) |
|
|
|
if (num_so_outputs > PIPE_MAX_SO_OUTPUTS) |
|
|
|
return EINVAL; |
|
|
|
return EINVAL; |
|
|
|
|
|
|
|
|
|
|
|