diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-08-12 17:26:36 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2008-08-12 17:26:36 +0000 |
commit | cb5b96cde0842a4a215a49b45ea74ae38a3f02f7 (patch) | |
tree | 53194ab6aee4a8bf78cb592d4b24fb139dce101d /libavformat/utils.c | |
parent | ebc22cc29f0bf9c87afbfef25e00338d92a9f0f3 (diff) | |
download | ffmpeg-cb5b96cde0842a4a215a49b45ea74ae38a3f02f7.tar.gz |
Prevent dts generation code to be executed when delay is > MAX_REORDER_DELAY,
this fixes overflow in AVStream->pts_buffer.
Originally committed as revision 14714 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 0ed479886b..723427a6b4 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -895,7 +895,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st, } } - if(pkt->pts != AV_NOPTS_VALUE){ + if(pkt->pts != AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY){ st->pts_buffer[0]= pkt->pts; for(i=1; i<delay+1 && st->pts_buffer[i] == AV_NOPTS_VALUE; i++) st->pts_buffer[i]= (i-delay-1) * pkt->duration; @@ -2524,7 +2524,7 @@ static int compute_pkt_fields2(AVStream *st, AVPacket *pkt){ } //calculate dts from pts - if(pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE){ + if(pkt->pts != AV_NOPTS_VALUE && pkt->dts == AV_NOPTS_VALUE && delay <= MAX_REORDER_DELAY){ st->pts_buffer[0]= pkt->pts; for(i=1; i<delay+1 && st->pts_buffer[i] == AV_NOPTS_VALUE; i++) st->pts_buffer[i]= (i-delay-1) * pkt->duration; |