summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-06-16 09:39:33 -0600
committerBrian Paul <brianp@vmware.com>2009-06-17 11:30:04 -0600
commit0ccde338282cd5f2bc2e40a145855cb30825a86c (patch)
treef11593efe45e77361927577e503a86f35ca07e7c /src
parenta24e8ae81d5081e085f694924b186bdd0ac680b8 (diff)
mesa: fix incorrect viewport clamping in _mesa_set_viewport()
A 0 by 0 viewport size is legal. Don't clamp against lower bound of one. The error checking earlier in the function prevents negative values.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/matrix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
index 0f96f949096..7cfa2dd1246 100644
--- a/src/mesa/main/matrix.c
+++ b/src/mesa/main/matrix.c
@@ -580,8 +580,8 @@ _mesa_set_viewport( GLcontext *ctx, GLint x, GLint y,
}
/* clamp width and height to the implementation dependent range */
- width = CLAMP(width, 1, (GLsizei) ctx->Const.MaxViewportWidth);
- height = CLAMP(height, 1, (GLsizei) ctx->Const.MaxViewportHeight);
+ width = MIN2(width, (GLsizei) ctx->Const.MaxViewportWidth);
+ height = MIN2(height, (GLsizei) ctx->Const.MaxViewportHeight);
ctx->Viewport.X = x;
ctx->Viewport.Width = width;