summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-22 22:10:28 +0000
committerreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-01-22 22:10:28 +0000
commit3526daed7ac957586b5a855ec56b4736191e7907 (patch)
tree277dabc6259a6ac0772dc706772fe51a37adcef3
parent7b953c1763bc3c1d4f8c051efe160989235385ef (diff)
downloadmpv-3526daed7ac957586b5a855ec56b4736191e7907.tar.bz2
mpv-3526daed7ac957586b5a855ec56b4736191e7907.tar.xz
Fix sub_free to actually free the subtitle data.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@30390 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--subreader.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/subreader.c b/subreader.c
index 8682b6eadf..54de174009 100644
--- a/subreader.c
+++ b/subreader.c
@@ -2249,15 +2249,15 @@ void dump_sami(sub_data* subd, float fps) {
void sub_free( sub_data * subd )
{
- int i;
+ int i, j;
if ( !subd ) return;
- if (subd->subtitles) {
- for (i=0; i < subd->subtitles->lines; i++) free( subd->subtitles->text[i] );
- free( subd->subtitles );
- }
- if (subd->filename) free( subd->filename );
+ for (i = 0; i < subd->sub_num; i++)
+ for (j = 0; j < subd->subtitles[i].lines; j++)
+ free( subd->subtitles[i].text[j] );
+ free( subd->subtitles );
+ free( subd->filename );
free( subd );
}