diff options
author | wm4 <wm4@nowhere> | 2013-04-12 18:34:30 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-04-12 18:34:30 +0200 |
commit | ed55e32911166173011be36f03ebb24ce08efdae (patch) | |
tree | 3e6e3ae3fd4173c6f0c0fc31595f95068d43a6ea | |
parent | b55b2256e6ff3b7cad2f5c00932c21c07d01302f (diff) | |
download | libass-ed55e32911166173011be36f03ebb24ce08efdae.tar.bz2 libass-ed55e32911166173011be36f03ebb24ce08efdae.tar.xz |
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.
-rw-r--r-- | libass/ass_parse.c | 4 |
1 files 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); |