From: Anuj Phogat Date: Thu, 7 Mar 2013 22:05:38 +0000 (-0800) Subject: mesa: Fix FB blitting in case of zero size src or dst rect X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d78dcdf103271c539ff246651236e71f7a9c10fd;p=mesa.git mesa: Fix FB blitting in case of zero size src or dst rect Framebuffer blitting operation should be skipped if any of the dimensions (width/height) of src/dst rect is zero. V2: Move the dimension check after error checking in _mesa_BlitFramebuffer. Fixes: fbblit(negative.nullblit.zeroSize) in Intel oglconform https://bugs.freedesktop.org/show_bug.cgi?id=59495 Note: Candidate for all the stable branches. Signed-off-by: Anuj Phogat Reviewed-by: Paul Berry --- diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index d6acc5896e8..0126e293051 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -3190,7 +3190,9 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, } } - if (!mask) { + if (!mask || + (srcX1 - srcX0) == 0 || (srcY1 - srcY0) == 0 || + (dstX1 - dstX0) == 0 || (dstY1 - dstY0) == 0) { return; }