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

vrend: fix potential crash with resource 0 creation

Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@gmail.com>
parent 11464687
......@@ -3890,6 +3890,10 @@ void vrend_renderer_resource_detach_iov(int res_handle,
static int check_resource_valid(struct vrend_renderer_resource_create_args *args)
{
/* do not accept handle 0 */
if (args->handle == 0)
return -1;
/* limit the target */
if (args->target >= PIPE_MAX_TEXTURE_TYPES)
return -1;
......
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