summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-01-19 02:01:09 +0000
committerEric Anholt <eric@anholt.net>2016-01-26 12:02:54 -0800
commit1fd82c764d5b24107e60f2173e30e5d24a2f2667 (patch)
tree29e22111f680b41d39920f15550ed0c429b58748
parente7308b6c77561df44c04f81509f8ada678705d94 (diff)
glamor: don't do copy if we have 0 boxes to copy.
This happens if you run twm + mplayer + xclock and drag the clock over the mplayer. If we don't catch it, we cause an illegal draw elements command to be passed to GL. Signed-off-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Anholt <eric@anholt.net>
-rw-r--r--glamor/glamor_copy.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index 028acf239..1adfba0e6 100644
--- a/glamor/glamor_copy.c
+++ b/glamor/glamor_copy.c
@@ -640,6 +640,9 @@ glamor_copy(DrawablePtr src,
Pixel bitplane,
void *closure)
{
+ if (nbox == 0)
+ return;
+
if (glamor_copy_gl(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure))
return;
glamor_copy_bail(src, dst, gc, box, nbox, dx, dy, reverse, upsidedown, bitplane, closure);