summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/buffers.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2002-02-15 16:25:16 +0000
committerBrian Paul <[email protected]>2002-02-15 16:25:16 +0000
commit70b8d304bb5224698aaf9d76dd603c8293d0bbf3 (patch)
tree15b5e8881fd329e47ae2a55beae8af63ac09cd5b /src/mesa/main/buffers.c
parent4ba35633d65be1ade60946bba36b5dd51880e13a (diff)
added a glClear() error check
Diffstat (limited to 'src/mesa/main/buffers.c')
-rw-r--r--src/mesa/main/buffers.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
index 2fa540250ab..b4feb219fbf 100644
--- a/src/mesa/main/buffers.c
+++ b/src/mesa/main/buffers.c
@@ -1,10 +1,10 @@
-/* $Id: buffers.c,v 1.31 2001/09/14 21:36:43 brianp Exp $ */
+/* $Id: buffers.c,v 1.32 2002/02/15 16:25:16 brianp Exp $ */
/*
* Mesa 3-D graphics library
- * Version: 3.5
+ * Version: 4.1
*
- * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -99,6 +99,15 @@ _mesa_Clear( GLbitfield mask )
if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glClear 0x%x\n", mask);
+ if (mask & ~(GL_COLOR_BUFFER_BIT |
+ GL_DEPTH_BUFFER_BIT |
+ GL_STENCIL_BUFFER_BIT |
+ GL_ACCUM_BUFFER_BIT)) {
+ /* invalid bit set */
+ _mesa_error( ctx, GL_INVALID_VALUE, "glClear(mask)");
+ return;
+ }
+
if (ctx->NewState) {
_mesa_update_state( ctx ); /* update _Xmin, etc */
}