[PATCH libXrender] Fix request length calculation for XRenderCompositeText32

Clemens Eisserer linuxhippy at gmail.com
Fri Nov 15 04:11:10 PST 2013


Hi,

Request length calculation inside XRenderCompositeText32 is broken for
the case where the number of glyphs fits exactky inside the last
xGlyphElt.
In XRenderCompositeText8 and XRenderCompositeText16 this case is
handled properly, somehow the "-1" got missing in
XRenderCompositeText32.

 src/Glyph.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/Glyph.c b/src/Glyph.c
index dbeb77e..48e40c3 100644
--- a/src/Glyph.c
+++ b/src/Glyph.c
@@ -665,7 +665,7 @@ XRenderCompositeText32 (Display                *dpy,
         len += (SIZEOF (xGlyphElt) + 4) >> 2;
     }
     nchars = elts[i].nchars;
-    elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32) / MAX_32) + nchars *4;
+    elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32-1) / MAX_32) + nchars *4;
     len += (elen + 3) >> 2;
     }

Regards, Clemens


More information about the xorg-devel mailing list