From 3fb6d0bfde9cc330ac6feaf0d642837247d97f98 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 15 Jan 2002 21:50:15 +0000 Subject: added some missing error checks --- src/mesa/swrast/s_drawpix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa/swrast/s_drawpix.c') diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index e618dc0a233..5a0bf241d2a 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -1,4 +1,4 @@ -/* $Id: s_drawpix.c,v 1.22 2001/06/26 21:15:36 brianp Exp $ */ +/* $Id: s_drawpix.c,v 1.22.2.1 2002/01/15 21:50:15 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -560,6 +560,11 @@ draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, return; } + if (ctx->Visual.stencilBits == 0) { + _mesa_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(no stencil buffer)"); + return; + } + drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; for (row = 0; row < height; row++, y++) { -- cgit v1.2.3