From e1e857744290f0a09d60435e8d5997efb0a436ba Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 14 Jul 2012 22:35:18 -0700 Subject: Handle big-requests when calculating request contents from length field Adds a getreqlen inline function to handle the big requests check. As noted in the comment, it must be called *before* the printreqlen macro does its own check, since printreqlen "fixes" the buf pointer when it's done to align all the remaining fields with their correct positions after skipping over the extra big requests 32-bit length field after the normal 16-bit length field. Signed-off-by: Alan Coopersmith --- print_render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'print_render.c') diff --git a/print_render.c b/print_render.c index f8d14e3..769fde5 100644 --- a/print_render.c +++ b/print_render.c @@ -432,15 +432,15 @@ RenderAddGlyphsFromPicture(FD fd, const unsigned char *buf) void RenderFreeGlyphs(FD fd, const unsigned char *buf) { - unsigned short n; + uint32_t n; RenderRequestHeader(fd, buf); if (Verbose < 1) return; + n = (getreqlen(fd, buf) - 2); printreqlen(buf, fd, CONST2(2)); PrintField(buf, 4, 4, GLYPHSET, "glyphset"); - n = (IShort(&buf[2]) - 2); (void) PrintList(&buf[8], (long) n, CARD32, "glyphs"); } -- cgit v1.2.1