Skip to content

Commit

Permalink
drawing: reject drawings not starting with m
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOneric committed Jan 9, 2024
1 parent 344b8a9 commit 9f21dbe
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion libass/ass_drawing.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 9f21dbe

Please sign in to comment.