summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2003-11-18 03:42:17 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2003-11-18 03:42:17 +0000
commit10b09212e8e3adc1751ae32bb632ad9bd8287c64 (patch)
tree9997ada1c686216b351c1d9139071995bbc1da1d
parent7eb3e9b9648938500c6172a88fb2998e6264467f (diff)
added missing <type> error checking in read_index_pixels()
-rw-r--r--src/mesa/swrast/s_readpix.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 00aa43d07c..f2b91e0528 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -1,9 +1,8 @@
-
/*
* Mesa 3-D graphics library
- * Version: 4.1
+ * Version: 5.1
*
- * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2003 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"),
@@ -61,6 +60,17 @@ read_index_pixels( GLcontext *ctx,
return;
}
+ if (type != GL_BYTE &&
+ type != GL_UNSIGNED_BYTE &&
+ type != GL_SHORT &&
+ type != GL_UNSIGNED_SHORT &&
+ type != GL_INT &&
+ type != GL_UNSIGNED_INT &&
+ type != GL_FLOAT) {
+ _mesa_error( ctx, GL_INVALID_OPERATION, "glReadPixels(index type)");
+ return;
+ }
+
_swrast_use_read_buffer(ctx);
readWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width;