[MPlayer-cvslog] r29514 - trunk/libass/ass.c

greg subversion at mplayerhq.hu
Fri Aug 14 00:52:45 CEST 2009


Author: greg
Date: Fri Aug 14 00:52:45 2009
New Revision: 29514

Log:
Fix crash when event format is not specified

Patch by Andrew Savchenko <bircoph at gmail.com>.

Modified:
   trunk/libass/ass.c

Modified: trunk/libass/ass.c
==============================================================================
--- trunk/libass/ass.c	Thu Aug 13 23:54:08 2009	(r29513)
+++ trunk/libass/ass.c	Fri Aug 14 00:52:45 2009	(r29514)
@@ -270,8 +270,15 @@ static int process_event_tail(ass_track_
 	int i;
 	ass_event_t* target = event;
 
-	char* format = strdup(track->event_format);
-	char* q = format; // format scanning pointer
+	char* format;
+	char* q; // format scanning pointer
+
+	if (!track->event_format) {
+		track->event_format = strdup("Format: Marked, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text");
+		mp_msg(MSGT_ASS, MSGL_V, "Event format is broken, reseting to defaults.\n");
+	}
+
+	q = format = strdup(track->event_format);
 
 	if (track->n_styles == 0) {
 		// add "Default" style to the end


More information about the MPlayer-cvslog mailing list