summaryrefslogtreecommitdiff
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-04-02 13:05:55 -0600
committerBrian Paul <brianp@vmware.com>2009-04-02 13:05:55 -0600
commit7b9bf395433b5fa9d5a95186891a29d49e0b47c0 (patch)
treea71d3124e4e55a1ed27e53659a1e713bf820728b /src/mesa/main
parentf6a3f1f52a969c8d990a3a41e816af4864eea45c (diff)
mesa: don't call ctx->Driver.ReadPixels() if width or height is zero
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/readpix.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index dfdd297b6e..2326776ecb 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)) {