]> granicus.if.org Git - libass/commitdiff
Load embedded fonts from memory correctly
authorwm4 <wm4@nowhere>
Tue, 4 Nov 2014 20:08:58 +0000 (21:08 +0100)
committerwm4 <wm4@nowhere>
Tue, 4 Nov 2014 20:08:58 +0000 (21:08 +0100)
libass/ass.c

index 892a627ac32dc485d442053bb4c6a40a0c54adbd..63c31a6324409d6bce074937bdc99e4fad113c14 100644 (file)
@@ -776,12 +776,6 @@ static int process_line(ASS_Track *track, char *str)
             break;
         }
     }
-
-    // there is no explicit end-of-font marker in ssa/ass
-    if ((track->parser_priv->state != PST_FONTS)
-        && (track->parser_priv->fontname))
-        decode_font(track);
-
     return 0;
 }
 
@@ -809,6 +803,9 @@ static int process_text(ASS_Track *track, char *str)
             break;
         p = q;
     }
+    // there is no explicit end-of-font marker in ssa/ass
+    if (track->parser_priv->fontname)
+        decode_font(track);
     return 0;
 }
 
@@ -1088,10 +1085,6 @@ static ASS_Track *parse_memory(ASS_Library *library, char *buf)
     for (i = 0; i < track->n_events; ++i)
         track->events[i].ReadOrder = i;
 
-    // there is no explicit end-of-font marker in ssa/ass
-    if (track->parser_priv->fontname)
-        decode_font(track);
-
     if (track->track_type == TRACK_TYPE_UNKNOWN) {
         ass_free_track(track);
         return 0;