summaryrefslogtreecommitdiffstats
path: root/libhb/stream.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2015-02-17 21:10:37 +0000
committerjstebbins <[email protected]>2015-02-17 21:10:37 +0000
commit58cb5e24567bacf701e07a9f5f2a51f6c65af9ab (patch)
treec0be1c2b28bfb04490b5547cbf32406336e1cb3f /libhb/stream.c
parent04f56b1f592d5851c5f97623565fc209e1d2c827 (diff)
stream: fix potential overflow in pts calculation
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6919 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/stream.c')
-rw-r--r--libhb/stream.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libhb/stream.c b/libhb/stream.c
index c21a04e95..81d8da2fc 100644
--- a/libhb/stream.c
+++ b/libhb/stream.c
@@ -1558,11 +1558,11 @@ static struct pts_pos hb_sample_pts(hb_stream_t *stream, uint64_t fpos)
hb_log("hb_sample_pts: no PTS in video packet near %"PRIu64, fpos);
return pp;
}
- pp.pts = ( ( (uint64_t)pes[9] >> 1 ) & 7 << 30 ) |
- ( (uint64_t)pes[10] << 22 ) |
- ( ( (uint64_t)pes[11] >> 1 ) << 15 ) |
- ( (uint64_t)pes[12] << 7 ) |
- ( (uint64_t)pes[13] >> 1 );
+ pp.pts = ((((uint64_t)pes[ 9] >> 1 ) & 7) << 30) |
+ ( (uint64_t)pes[10] << 22) |
+ ( ((uint64_t)pes[11] >> 1 ) << 15) |
+ ( (uint64_t)pes[12] << 7 ) |
+ ( (uint64_t)pes[13] >> 1 );
if ( ts_isIframe( stream, buf, adapt_len ) )
{