summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libass/ass.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libass/ass.c b/libass/ass.c
index f7f5bcc..6becb39 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -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)