[MPlayer-cvslog] r30390 - trunk/subreader.c

reimar subversion at mplayerhq.hu
Fri Jan 22 23:10:28 CET 2010


Author: reimar
Date: Fri Jan 22 23:10:28 2010
New Revision: 30390

Log:
Fix sub_free to actually free the subtitle data.

Modified:
   trunk/subreader.c

Modified: trunk/subreader.c
==============================================================================
--- trunk/subreader.c	Fri Jan 22 22:49:05 2010	(r30389)
+++ trunk/subreader.c	Fri Jan 22 23:10:28 2010	(r30390)
@@ -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 );
 }
 


More information about the MPlayer-cvslog mailing list