summaryrefslogtreecommitdiff
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-02-26 22:13:32 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-02-26 22:13:32 +0000
commite6149fac64da1653a315687465a1d83bd8373612 (patch)
tree702eaae2e24bd80315f1386ff4406660748b049c /src/mesa
parent1ef3d3a7589eeabf0229cb3c6a9419d0eef2a681 (diff)
check for invalid fragment program in glDrawPixels, glCopyPixels and glBitmap
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/drawpix.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
index 12b9f2930d..745d7a304d 100644
--- a/src/mesa/main/drawpix.c
+++ b/src/mesa/main/drawpix.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 6.0.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2004 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"),
@@ -45,6 +44,13 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (ctx->FragmentProgram.Enabled
+ && !ctx->FragmentProgram.Current->Instructions) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glDrawPixels (invalid fragment program)");
+ return;
+ }
+
if (width < 0 || height < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0" );
return;
@@ -95,6 +101,13 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
GLint destx, desty;
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (ctx->FragmentProgram.Enabled
+ && !ctx->FragmentProgram.Current->Instructions) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glCopyPixels (invalid fragment program)");
+ return;
+ }
+
if (width < 0 || height < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)" );
return;
@@ -176,6 +189,13 @@ _mesa_Bitmap( GLsizei width, GLsizei height,
GET_CURRENT_CONTEXT(ctx);
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
+ if (ctx->FragmentProgram.Enabled
+ && !ctx->FragmentProgram.Current->Instructions) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glBitmap (invalid fragment program)");
+ return;
+ }
+
if (width < 0 || height < 0) {
_mesa_error( ctx, GL_INVALID_VALUE, "glBitmap(width or height < 0)" );
return;