Commit 9ea55926 authored by bcoudurier's avatar bcoudurier

Prevent dts generation code to be executed when delay is > MAX_REORDER_DELAY,

this fixes overflow in AVStream->pts_buffer.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@14714 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d76f5dde
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment