Re: [Mesa-dev] [PATCH V2] mesa: Fix FB blitting in case of zero size src or dst rect

2013-03-15 Thread Ian Romanick

On 03/08/2013 10:14 AM, Anuj Phogat wrote:

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


Reference the bug below as...



Note: Candidate for all the stable branches.

Signed-off-by: Anuj Phogat anuj.pho...@gmail.com


Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=59495
Reviewed-by: Ian Romanick ian.d.roman...@intel.com


---
  src/mesa/main/fbobject.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index d6acc58..0126e29 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;
 }




___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH V2] mesa: Fix FB blitting in case of zero size src or dst rect

2013-03-08 Thread Anuj Phogat
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 anuj.pho...@gmail.com
---
 src/mesa/main/fbobject.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index d6acc58..0126e29 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;
}
 
-- 
1.7.11.7

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev