]> granicus.if.org Git - libass/commitdiff
Don't flag for freeing if codepage is unspecified
authorGrigori Goronzy <greg@blackbox>
Wed, 6 Jan 2010 09:44:23 +0000 (10:44 +0100)
committerGrigori Goronzy <greg@blackbox>
Wed, 6 Jan 2010 09:44:23 +0000 (10:44 +0100)
Patch by Arne Morten Kvarving <spiff@micron.(none)>.

libass/ass.c

index f7f5bccd4bcb259db570dae5b9ec1c56fdba6085..6becb39e8e990536f78d7b6b7309d94b669da292 100644 (file)
@@ -1100,12 +1100,13 @@ ASS_Track *ass_read_memory(ASS_Library *library, char *buf,
         return 0;
 
 #ifdef CONFIG_ICONV
-    if (codepage)
+    if (codepage) {
         buf = sub_recode(library, buf, bufsize, codepage);
-    if (!buf)
-        return 0;
-    else
-        need_free = 1;
+        if (!buf)
+            return 0;
+        else
+            need_free = 1;
+    }
 #endif
     track = parse_memory(library, buf);
     if (need_free)