1 diff -ruN libass/libass/ass.c libass.update/libass/ass.c
2 --- libass/libass/ass.c 2008-05-22 20:01:18.000000000 +0200
3 +++ libass.update/libass/ass.c 2008-08-04 04:10:14.000000000 +0200
10 - outbuf = malloc(size);
11 + outbuf = malloc(osize);
18 rc = iconv(icdsc, &ip, &ileft, &op, &oleft);
19 + else {// clear the conversion state and leave
21 + rc = iconv(icdsc, NULL, NULL, &op, &oleft);
23 if (rc == (size_t)(-1)) {
25 - int offset = op - outbuf;
26 + size_t offset = op - outbuf;
27 outbuf = (char*)realloc(outbuf, osize + size);
31 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_ErrorRecodingFile);
39 outbuf[osize - oleft - 1] = 0;
41 diff -ruN libass/libass/ass_fontconfig.c libass.update/libass/ass_fontconfig.c
42 --- libass/libass/ass_fontconfig.c 2008-05-22 20:01:18.000000000 +0200
43 +++ libass.update/libass/ass_fontconfig.c 2008-08-04 04:14:45.000000000 +0200
47 fset = FcFontSort(priv->config, pat, FcTrue, NULL, &result);
51 for (curf = 0; curf < fset->nfont; ++curf) {
52 FcPattern* curp = fset->fonts[curf];
57 + int face_index, num_faces = 1;
59 - rc = FT_New_Memory_Face(ftlibrary, (unsigned char*)data, data_size, 0, &face);
60 + for (face_index = 0; face_index < num_faces; ++face_index) {
61 + rc = FT_New_Memory_Face(ftlibrary, (unsigned char*)data, data_size, 0, &face);
63 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_ErrorOpeningMemoryFont, name);
66 + num_faces = face->num_faces;
68 pattern = FcFreeTypeQueryFace(face, (unsigned char*)name, 0, FcConfigGetBlanks(priv->config));
79 for (i = 0; i < library->num_fontdata; ++i)
80 process_fontdata(priv, library, ftlibrary, i);
82 - if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
84 + if (FcDirCacheValid((const FcChar8 *)dir) == FcFalse)
86 mp_msg(MSGT_ASS, MSGL_INFO, MSGTR_LIBASS_UpdatingFontCache);
87 if (FcGetVersion() >= 20390 && FcGetVersion() < 20400)
90 mp_msg(MSGT_ASS, MSGL_WARN, MSGTR_LIBASS_FcConfigAppFontAddDirFailed);
94 priv->family_default = family ? strdup(family) : 0;
95 priv->path_default = path ? strdup(path) : 0;
96 diff -ruN libass/libass/ass_render.c libass.update/libass/ass_render.c
97 --- libass/libass/ass_render.c 2008-05-22 20:01:18.000000000 +0200
98 +++ libass.update/libass/ass_render.c 2008-08-04 04:16:01.000000000 +0200
100 * \param pwr multiplier for some tag effects (comes from \t tags)
102 static char* parse_tag(char* p, double pwr) {
103 -#define skip_all(x) if (*p == (x)) ++p; else { \
104 - while ((*p != (x)) && (*p != '}') && (*p != 0)) {++p;} }
105 +#define skip_to(x) while ((*p != (x)) && (*p != '}') && (*p != 0)) { ++p;}
106 #define skip(x) if (*p == (x)) ++p; else { return p; }
111 if ((*p == '}') || (*p == 0))
115 } else if (mystrcmp(&p, "fn")) {
121 family = malloc(p - start + 1);
122 strncpy(family, start, p - start);
126 p = parse_tag(p, k); // maybe k*pwr ? no, specs forbid nested \t's
127 - skip_all(')'); // FIXME: better skip(')'), but much more tags support required
128 + skip_to(')'); // in case there is some unknown tag or a comment
130 } else if (mystrcmp(&p, "clip")) {
133 @@ -1031,7 +1032,7 @@