CVS: main/libmpdemux demux_mkv.cpp,1.42,1.43
Update of /cvsroot/mplayer/main/libmpdemux In directory mail:/var/tmp.root/cvs-serv6778 Modified Files: demux_mkv.cpp Log Message: * fix my 100l from before * SSA is also ASS * avoid multiple segfaults when there are more then SUB_MAX_TEXT-1 lines at the same time Index: demux_mkv.cpp =================================================================== RCS file: /cvsroot/mplayer/main/libmpdemux/demux_mkv.cpp,v retrieving revision 1.42 retrieving revision 1.43 diff -u -r1.42 -r1.43 --- demux_mkv.cpp 26 Oct 2003 12:28:45 -0000 1.42 +++ demux_mkv.cpp 26 Oct 2003 21:09:37 -0000 1.43 @@ -491,6 +491,12 @@ line = 0; mkv_d->subs.lines++; + if (mkv_d->subs.lines> SUB_MAX_TEXT - 1 ) + { + mp_msg(MSGT_DEMUX, MSGL_WARN,"[mkv] Warning: too many sublines to render, skipping\n"); + mkv_d->subs.lines--; + return; + } s2 = mkv_d->subs.text[mkv_d->subs.lines - 1]; state = 0; @@ -2357,10 +2363,11 @@ sizeof(mkv_sh_sub_t)); demuxer->sub->id = track->xid; - } else if (!(strcmp(track->codec_id, MKV_S_TEXTASCII) && + } else if (strcmp(track->codec_id, MKV_S_TEXTASCII) && strcmp(track->codec_id, MKV_S_TEXTUTF8) && strcmp(track->codec_id, MKV_S_TEXTSSA) && - strcmp(track->codec_id, "S_SSA"))) + strcmp(track->codec_id, "S_SSA") && + strcmp(track->codec_id, "S_TEXT/ASS")) mp_msg(MSGT_DEMUX, MSGL_ERR, "[mkv] Subtitle type '%s' is not " "supported. Track will not be displayed.\n", track->codec_id); else { @@ -2374,7 +2381,8 @@ if (!strcmp(track->codec_id, MKV_S_TEXTUTF8)) sub_utf8 = 1; // Force UTF-8 conversion. if (!strcmp(track->codec_id, MKV_S_TEXTSSA) || - !strcmp(track->codec_id, "S_SSA")) { + !strcmp(track->codec_id, "S_SSA") || + !strcmp(track->codec_id, "S_TEXT/ASS")) { mkv_d->subtitle_type = MKV_SUBTYPE_SSA; sub_utf8 = 1; } else
On Sun, 26 Oct 2003 22:09:57 +0100 Attila Kinali CVS <attila@mplayerhq.hu> wrote:
* avoid multiple segfaults when there are more then SUB_MAX_TEXT-1 lines at the same time
+ if (mkv_d->subs.lines> SUB_MAX_TEXT - 1 ) + { + mp_msg(MSGT_DEMUX, MSGL_WARN,"[mkv] Warning: too many sublines to render, skipping\n"); + mkv_d->subs.lines--; + return; + }
Moritz, can you go trough demux_mkv.cpp and fix this ? The segfault comes from the clearing while loop at line 2867 Also, has anyone a good idea what to do if some ****** encoder thinks he has to put every word of a sentence on its own line ? At the moment this code just drops them after the 9th word. Attila Kinali -- egp ist vergleichbar mit einem ikea bausatz fuer flugzeugtraeger -- reeler in +kaosu
On Sunday 26 October 2003 22:15, Attila Kinali wrote:
On Sun, 26 Oct 2003 22:09:57 +0100
Attila Kinali CVS <attila@mplayerhq.hu> wrote:
* avoid multiple segfaults when there are more then SUB_MAX_TEXT-1 lines at the same time
+ if (mkv_d->subs.lines> SUB_MAX_TEXT - 1 ) + { + mp_msg(MSGT_DEMUX, MSGL_WARN,"[mkv] Warning: too many sublines to render, skipping\n"); + mkv_d->subs.lines--; + return; + }
Moritz, can you go trough demux_mkv.cpp and fix this ? The segfault comes from the clearing while loop at line 2867
Also, has anyone a good idea what to do if some ****** encoder thinks he has to put every word of a sentence on its own line ? At the moment this code just drops them after the 9th word. How about caching em up until a reasonable line length is reached and then flusing it out to the osd?
Attila Kinali
-- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
On Mon, 27 Oct 2003 03:02:07 +0200 Felix Buenemann <atmosfear@users.sourceforge.net> wrote:
How about caching em up until a reasonable line length is reached and then flusing it out to the osd?
The problem here is, that there are (clean formated) multi line subs and i dont want to mess with them. Maybe i should look for single word lines. Attila Kinali -- egp ist vergleichbar mit einem ikea bausatz fuer flugzeugtraeger -- reeler in +kaosu
On Monday 27 October 2003 08:28, Attila Kinali wrote:
On Mon, 27 Oct 2003 03:02:07 +0200
Felix Buenemann <atmosfear@users.sourceforge.net> wrote:
How about caching em up until a reasonable line length is reached and then flusing it out to the osd?
The problem here is, that there are (clean formated) multi line subs and i dont want to mess with them. Maybe i should look for single word lines. yes, if there are three ore more lines of single words, it's probably a good enough guess?
Attila Kinali
-- Best Regards, Atmos ____________________________________________ - MPlayer Developer - http://mplayerhq.hu/ - ____________________________________________
participants (3)
-
Attila Kinali -
Attila Kinali CVS -
Felix Buenemann