Module: Mesa
Branch: mesa_7_4_branch
Commit: 6ef0951b174b7eda71ccf4a7ac4881df62829843
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ef0951b174b7eda71ccf4a7ac4881df62829843

Author: Brian Paul <bri...@vmware.com>
Date:   Thu Apr  2 13:11:33 2009 -0600

mesa: don't call ctx->Driver.ReadPixels() if width or height is zero

(cherry picked from commit master, 7b9bf395433b5fa9d5a95186891a29d49e0b47c0)

---

 src/mesa/main/readpix.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index dfdd297..2326776 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -170,6 +170,9 @@ _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei 
height,
       return;
    }
 
+   if (width == 0 || height == 0)
+      return; /* nothing to do */
+
    if (ctx->Pack.BufferObj->Name) {
       if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1,
                                      format, type, pixels)) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to