diff options
author | Oneric <oneric@oneric.stub> | 2024-01-03 23:57:20 +0100 |
---|---|---|
committer | Oneric <oneric@oneric.stub> | 2024-01-09 02:03:39 +0100 |
commit | 9f21dbe6aeed336632dadd500c98b2ff7eab3cfa (patch) | |
tree | f262ed9e4a16f207e03c072efbf15cb90bb5e091 | |
parent | 344b8a912a1740813738142c90fb45ea87eb1fc4 (diff) | |
download | libass-9f21dbe6aeed336632dadd500c98b2ff7eab3cfa.tar.bz2 libass-9f21dbe6aeed336632dadd500c98b2ff7eab3cfa.tar.xz |
drawing: reject drawings not starting with m
Fixes https://github.com/libass/libass/issues/719
-rw-r--r-- | libass/ass_drawing.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/libass/ass_drawing.c b/libass/ass_drawing.c index 43cf9c3..9343425 100644 --- a/libass/ass_drawing.c +++ b/libass/ass_drawing.c @@ -108,8 +108,21 @@ static ASS_DrawingToken *drawing_tokenize(const char *str) tail->next = calloc(1, sizeof(ASS_DrawingToken)); tail->next->prev = tail; tail = tail->next; - } else + } else { + /* VSFilter compat: + * In guliverkli(2) VSFilter all drawings + * whose first valid command isn't m are rejected. + * xy-VSF and MPC-HC ISR this was (possibly inadvertenly) later relaxed, + * such that all valid commands but n are ignored if there was no m yet. + */ + if (type == TOKEN_MOVE_NC) { + return NULL; + } else if (type != TOKEN_MOVE) { + p++; + continue; + } root = tail = calloc(1, sizeof(ASS_DrawingToken)); + } tail->type = type; tail->point = point; is_set = 0; |