mirror of
https://github.com/mpv-player/mpv
synced 2025-03-03 12:47:49 +00:00
Bugfix: potential write of unallocated memory.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19618 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
b792548aa7
commit
534fe740f5
@ -282,9 +282,11 @@ static int process_event_tail(ass_track_t* track, ass_event_t* event, char* str,
|
||||
if (strcasecmp(tname, "Text") == 0) {
|
||||
char* last;
|
||||
event->Text = strdup(p);
|
||||
last = event->Text + strlen(event->Text) - 1;
|
||||
if (*last == '\r')
|
||||
*last = 0;
|
||||
if (*event->Text != 0) {
|
||||
last = event->Text + strlen(event->Text) - 1;
|
||||
if (last >= event->Text && *last == '\r')
|
||||
*last = 0;
|
||||
}
|
||||
mp_msg(MSGT_GLOBAL, MSGL_DBG2, "Text = %s\n", event->Text);
|
||||
event->Duration -= event->Start;
|
||||
free(format);
|
||||
|
Loading…
Reference in New Issue
Block a user