summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>1999-10-19 20:33:57 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>1999-10-19 20:33:57 +0000
commitbc41b08073bd764d1844c4cc32bbd4cd0fc0b850 (patch)
tree0d97dc84eca0a81e84eed386d08286327f72b8ed
parentf3f9b773244d0c1f5518e07127a7c273d4e3989e (diff)
more image type error checking in draw_stencil_pixels()
-rw-r--r--src/mesa/main/drawpix.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 02016d1515..0b49428621 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,4 +1,4 @@
-/* $Id: drawpix.c,v 1.3 1999/10/08 09:27:10 keithw Exp $ */
+/* $Id: drawpix.c,v 1.4 1999/10/19 20:33:57 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -487,6 +487,18 @@ static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y,
GLint i;
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0;
+ if (image->Type != GL_BYTE &&
+ image->Type != GL_UNSIGNED_BYTE &&
+ image->Type != GL_SHORT &&
+ image->Type != GL_UNSIGNED_SHORT &&
+ image->Type != GL_INT &&
+ image->Type != GL_UNSIGNED_INT &&
+ image->Type != GL_FLOAT &&
+ image->Type != GL_BITMAP) {
+ gl_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(stencil type)");
+ return;
+ }
+
assert(image);
assert(image->Format == GL_STENCIL_INDEX);
assert(image->Type == GL_UNSIGNED_BYTE || image->Type == GL_BITMAP);