Bugfix: when copying ass_force_style_list, ending 0 was left out.
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 6 Nov 2006 20:09:28 +0000 (20:09 +0000)
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>
Mon, 6 Nov 2006 20:09:28 +0000 (20:09 +0000)
git-svn-id: svn://git.mplayerhq.hu/mplayer/trunk@20738 b3059339-0415-0410-9bf9-f77b7e298cf2

libass/ass_library.c

index f728aef..1928e43 100644 (file)
@@ -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;
 }