[MPlayer-cvslog] r37257 - in trunk/sub: av_sub.c spudec.c

reimar subversion at mplayerhq.hu
Sat Aug 23 16:23:37 CEST 2014


Author: reimar
Date: Sat Aug 23 16:23:37 2014
New Revision: 37257

Log:
Better handling of out-of-range subtitle timestamps.

Fixes decoding of PGS subtitles.

Modified:
   trunk/sub/av_sub.c
   trunk/sub/spudec.c

Modified: trunk/sub/av_sub.c
==============================================================================
--- trunk/sub/av_sub.c	Sat Aug 23 15:59:32 2014	(r37256)
+++ trunk/sub/av_sub.c	Sat Aug 23 16:23:37 2014	(r37257)
@@ -130,7 +130,7 @@ int decode_avsub(struct sh_sub *sh, uint
     if (res < 0)
         return res;
     if (*pts != MP_NOPTS_VALUE) {
-        if (sub.end_display_time > sub.start_display_time)
+        if (sub.end_display_time > sub.start_display_time && sub.end_display_time < 0x7fffffff)
             *endpts = *pts + sub.end_display_time / 1000.0;
         *pts += sub.start_display_time / 1000.0;
     }

Modified: trunk/sub/spudec.c
==============================================================================
--- trunk/sub/spudec.c	Sat Aug 23 15:59:32 2014	(r37256)
+++ trunk/sub/spudec.c	Sat Aug 23 16:23:37 2014	(r37257)
@@ -1426,9 +1426,9 @@ void spudec_packet_send(void *spu, packe
 {
   packet->start_pts = 0;
   packet->end_pts = 0x7fffffff;
-  if (pts != MP_NOPTS_VALUE)
+  if (pts != MP_NOPTS_VALUE && pts < 0xffffffffu / 90000)
     packet->start_pts = pts * 90000;
-  if (endpts != MP_NOPTS_VALUE)
+  if (endpts != MP_NOPTS_VALUE && endpts < 0xffffffffu / 90000)
     packet->end_pts = endpts * 90000;
   spudec_queue_packet(spu, packet);
 }


More information about the MPlayer-cvslog mailing list