diff options
-rw-r--r-- | libass/ass_library.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libass/ass_library.c b/libass/ass_library.c index f728aefbee..1928e4361c 100644 --- a/libass/ass_library.c +++ b/libass/ass_library.c @@ -66,7 +66,8 @@ void ass_set_style_overrides(ass_library_t* priv, char** list) for (p = list, cnt = 0; *p; ++p, ++cnt) {} - priv->style_overrides = malloc(cnt * sizeof(char*)); + priv->style_overrides = malloc((cnt + 1) * sizeof(char*)); for (p = list, q = priv->style_overrides; *p; ++p, ++q) *q = strdup(*p); + priv->style_overrides[cnt] = NULL; } |