[Mplayer-cvslog] CVS: main/libmpdemux demux_mkv.cpp,1.42,1.43

Attila Kinali CVS attila at mplayerhq.hu
Sun Oct 26 22:09:57 CET 2003


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



More information about the MPlayer-cvslog mailing list