changeset 18380:841789620ed1

in read_mpeg_timestamp() cast int expression to uint64_t before shifting to avoid truncation of bits and to prevent propagation of bit 1 as sign bit in pts
author nicodvb
date Wed, 03 May 2006 17:55:02 +0000
parents 386f4897e26b
children bbf33e805e74
files libmpdemux/demux_mpg.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Tue May 02 23:03:38 2006 +0000
+++ b/libmpdemux/demux_mpg.c	Wed May 03 17:55:02 2006 +0000
@@ -161,7 +161,7 @@
     ++mpeg_pts_error;
     return 0; // invalid pts
   }
-  pts=(((c>>1)&7)<<30)|((d>>1)<<15)|(e>>1);
+  pts=(((uint64_t)((c>>1)&7))<<30)|((d>>1)<<15)|(e>>1);
   mp_dbg(MSGT_DEMUX,MSGL_DBG3,"{%d}",pts);
   return pts;
 }