changeset 30348:afbbefa368ee

Fix sub_free to actually free the subtitle data.
author reimar
date Fri, 22 Jan 2010 22:10:28 +0000
parents 2f4948cd9a2a
children 74016937a51e
files subreader.c
diffstat 1 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/subreader.c	Fri Jan 22 21:49:05 2010 +0000
+++ b/subreader.c	Fri Jan 22 22:10:28 2010 +0000
@@ -2249,15 +2249,15 @@
 
 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 );
 }