[PATCH] glamor: don't do copy if we have 0 boxes to copy.

Dave Airlie airlied at gmail.com
Mon Jan 18 18:12:31 PST 2016


From: Dave Airlie <airlied at redhat.com>

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 at redhat.com>
---
 glamor/glamor_copy.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/glamor/glamor_copy.c b/glamor/glamor_copy.c
index 028acf2..1adfba0 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);
-- 
2.4.3



More information about the xorg-devel mailing list