summaryrefslogtreecommitdiffstats
path: root/libass
diff options
context:
space:
mode:
authoreugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 21:38:28 +0000
committereugeni <eugeni@b3059339-0415-0410-9bf9-f77b7e298cf2>2007-05-09 21:38:28 +0000
commit929e461eb0de18205313c85262703988d47a0877 (patch)
tree4b9004687ccd384b42f1e9d6d16d20267a0655cd /libass
parentfba7257f2d911e0114c734ebd95871399d6ba789 (diff)
downloadmpv-929e461eb0de18205313c85262703988d47a0877.tar.bz2
mpv-929e461eb0de18205313c85262703988d47a0877.tar.xz
Don't deallocate font data if it will be used later.
It produced either segfault or "Error opening memory font" with any script that contains embedded fonts. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@23282 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libass')
-rw-r--r--libass/ass.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libass/ass.c b/libass/ass.c
index 546e417972..f5e032c694 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -572,8 +572,10 @@ static int decode_font(ass_track_t* track)
dsize = q - buf;
assert(dsize <= size / 4 * 3 + 2);
- if (track->library->extract_fonts)
+ if (track->library->extract_fonts) {
ass_add_font(track->library, track->parser_priv->fontname, (char*)buf, dsize);
+ buf = 0;
+ }
error_decode_font:
if (buf) free(buf);