From 9be86b89fb25e54f7823a395dda99948d554fda1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Wed, 20 Jan 2016 13:58:03 +0100 Subject: [PATCH] renderer: check box bounds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix found thanks to american fuzzy lop. Signed-off-by: Marc-André Lureau --- src/vrend_renderer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c index 80641c2..12a9f7c 100644 --- a/src/vrend_renderer.c +++ b/src/vrend_renderer.c @@ -4337,7 +4337,8 @@ static bool check_transfer_bounds(struct vrend_resource *res, /* check mipmap level is in bounds */ if (info->level > res->base.last_level) 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 */ lwidth = u_minify(res->base.width0, info->level); if (info->box->width > lwidth)