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
This commit is contained in:
eugeni 2007-05-09 21:38:28 +00:00
parent fba7257f2d
commit 929e461eb0
1 changed files with 3 additions and 1 deletions

View File

@ -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);