vrend: fix potential crash with resource 0 creation

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 1146468715
commit fbee79ae2f
  1. 4
      src/vrend_renderer.c

@ -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;

Loading…
Cancel
Save