From: jstebbins Date: Tue, 17 Feb 2015 21:10:59 +0000 (+0000) Subject: merge stream: fix potential overflow in pts calculation X-Git-Tag: 0.10.1~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=264ee39dc2dbb3a966feb2849eaeb447c869086f;p=handbrake merge stream: fix potential overflow in pts calculation git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/0.10.x@6920 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- diff --git a/libhb/stream.c b/libhb/stream.c index d179ff3bb..6498331db 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 ) ) {