aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-04-30 10:36:15 +0200
committermarha <marha@users.sourceforge.net>2012-04-30 10:36:15 +0200
commit762b7fde3d57d3a151f98535fd31516b7e823bc0 (patch)
tree11c32921b96808f2aab11a86863534fb28b274f6 /mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
parentb68922d51f52ca6ab9daa0105ef5c57f35bfbdcf (diff)
downloadvcxsrv-762b7fde3d57d3a151f98535fd31516b7e823bc0.tar.gz
vcxsrv-762b7fde3d57d3a151f98535fd31516b7e823bc0.tar.bz2
vcxsrv-762b7fde3d57d3a151f98535fd31516b7e823bc0.zip
fontconfig libX11 libfontenc mesa pixman xserver git update 30 Apr 2012
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_cb_drawpixels.c')
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_drawpixels.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
index 5e078a85e..9a3f22465 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_drawpixels.c
@@ -1509,7 +1509,15 @@ st_CopyPixels(struct gl_context *ctx, GLint srcx, GLint srcy,
readY = srcy;
readW = width;
readH = height;
- _mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack);
+ if (!_mesa_clip_readpixels(ctx, &readX, &readY, &readW, &readH, &pack)) {
+ /* The source region is completely out of bounds. Do nothing.
+ * The GL spec says "Results of copies from outside the window,
+ * or from regions of the window that are not exposed, are
+ * hardware dependent and undefined."
+ */
+ return;
+ }
+
readW = MAX2(0, readW);
readH = MAX2(0, readH);