renderer: check box bounds

Fix found thanks to american fuzzy lop.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
macos/master
Marc-André Lureau 9 years ago committed by Dave Airlie
parent 901b77d29e
commit 9be86b89fb
  1. 3
      src/vrend_renderer.c

@ -4337,7 +4337,8 @@ static bool check_transfer_bounds(struct vrend_resource *res,
/* check mipmap level is in bounds */ /* check mipmap level is in bounds */
if (info->level > res->base.last_level) if (info->level > res->base.last_level)
return false; return false;
if (info->box->x < 0 || info->box->y < 0)
return false;
/* these will catch bad y/z/w/d with 1D textures etc */ /* these will catch bad y/z/w/d with 1D textures etc */
lwidth = u_minify(res->base.width0, info->level); lwidth = u_minify(res->base.width0, info->level);
if (info->box->width > lwidth) if (info->box->width > lwidth)

Loading…
Cancel
Save