Fix crash when event format is not specified

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

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29514 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
greg 2009-08-13 22:52:45 +00:00
parent d41e860bab
commit 629d7023da
1 changed files with 9 additions and 2 deletions

View File

@ -270,8 +270,15 @@ static int process_event_tail(ass_track_t* track, ass_event_t* event, char* str,
int i; int i;
ass_event_t* target = event; ass_event_t* target = event;
char* format = strdup(track->event_format); char* format;
char* q = format; // format scanning pointer 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) { if (track->n_styles == 0) {
// add "Default" style to the end // add "Default" style to the end