summaryrefslogtreecommitdiffstats
path: root/libass/ass_parse.c
diff options
context:
space:
mode:
Diffstat (limited to 'libass/ass_parse.c')
-rw-r--r--libass/ass_parse.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libass/ass_parse.c b/libass/ass_parse.c
index 5698669..0a25c64 100644
--- a/libass/ass_parse.c
+++ b/libass/ass_parse.c
@@ -262,7 +262,8 @@ static int parse_vector_clip(ASS_Renderer *render_priv,
/**
* \brief Parse style override tag.
* \param p string to parse
- * \param end end of string to parse, which must be '}' or ')'
+ * \param end end of string to parse, which must be '}', ')', or the first
+ * of a number of spaces immediately preceding '}' or ')'
* \param pwr multiplier for some tag effects (comes from \t tags)
*/
char *parse_tag(ASS_Renderer *render_priv, char *p, char *end, double pwr)
@@ -272,7 +273,8 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, char *end, double pwr)
if (*p != '\\')
return p;
++p;
- skip_spaces(&p);
+ if (p != end)
+ skip_spaces(&p);
char *q = p;
while (*q != '(' && *q != '\\' && q != end)
@@ -293,7 +295,8 @@ char *parse_tag(ASS_Renderer *render_priv, char *p, char *end, double pwr)
if (*q == '(') {
++q;
while (1) {
- skip_spaces(&q);
+ if (q != end)
+ skip_spaces(&q);
// Split on commas. If there is a backslash, ignore any
// commas following it and lump everything starting from