aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-03 17:55:02 +0000
committerGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-05-03 17:55:02 +0000
commitc5777d7f533fad16eb3f608b18e9c94e06ab57f9 (patch)
tree2c6c307b0adb91b00cdc91a71f8df03a1e96cd77
parent54a3ec649f57106347fe4c9f36154918787b3178 (diff)
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
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18381 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r--libmpdemux/demux_mpg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libmpdemux/demux_mpg.c b/libmpdemux/demux_mpg.c
index 33085e3544..1c5d430f4d 100644
--- a/libmpdemux/demux_mpg.c
+++ b/libmpdemux/demux_mpg.c
@@ -161,7 +161,7 @@ static unsigned long long read_mpeg_timestamp(stream_t *s,int c){
++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;
}