# HG changeset patch # User nicodvb # Date 1146678902 0 # Node ID 841789620ed16120aa65216a29f2adfd8a8fc7ca # Parent 386f4897e26b9b64e4eb555ed49cf04b43ee6068 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 diff -r 386f4897e26b -r 841789620ed1 libmpdemux/demux_mpg.c --- 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; }