From ed55e32911166173011be36f03ebb24ce08efdae Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 12 Apr 2013 18:34:30 +0200 Subject: Clip tag arguments are not optional This fixes: {\clip(1,1,20,20)\clip\alpha&H1E&\c&HC7E5C0&}X libass tries to interpret the second \clip, which has no arguments. Since the parsing code doesn't require a starting '(', the parser will skip over the other tags (treating them as junk) and interpret the numbers that happen to be in the rest of the string. The result is a bogus drawing command, which happens to rasterize an extremely wide glyph, which takes several seconds to finish. Make the '(' required. Neither the aegisub manual nor the vsfilter source code have any indication that \clip without starting '(' is allowed, so this should not break anything. --- libass/ass_parse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libass/ass_parse.c b/libass/ass_parse.c index f2f73e5..bb64971 100644 --- a/libass/ass_parse.c +++ b/libass/ass_parse.c @@ -311,7 +311,7 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr) int x0, y0, x1, y1; int res = 1; char *start = p; - skipopt('('); + skip('('); res &= mystrtoi(&p, &x0); skipopt(','); res &= mystrtoi(&p, &y0); @@ -669,7 +669,7 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, double pwr) char *start = p; int x0, y0, x1, y1; int res = 1; - skipopt('('); + skip('('); res &= mystrtoi(&p, &x0); skipopt(','); res &= mystrtoi(&p, &y0); -- cgit v1.2.3