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

renderer: reject large LOD values

Or we could sit for a very long time in some further loops.

Fix found thanks to american fuzzy lop.
Signed-off-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
parent f58e985a
......@@ -3935,6 +3935,8 @@ static int check_resource_valid(struct vrend_renderer_resource_create_args *args
/* buffer and rect textures can't have mipmaps */
if (args->target == PIPE_BUFFER || args->target == PIPE_TEXTURE_RECT)
return -1;
if (args->last_level > (floor(log2(MAX2(args->width, args->width))) + 1))
return -1;
}
if (args->flags != 0 && args->flags != VIRGL_RESOURCE_Y_0_TOP)
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