changeset 3710:48a262da0100 libavformat

Prevent dts generation code to be executed when delay is > MAX_REORDER_DELAY, this fixes overflow in AVStream->pts_buffer.
author bcoudurier
date Tue, 12 Aug 2008 17:26:36 +0000
parents 1c2e46d1f5c3
children a2bdb3bfeb99
files utils.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/utils.c	Tue Aug 12 12:36:00 2008 +0000
+++ b/utils.c	Tue Aug 12 17:26:36 2008 +0000
@@ -895,7 +895,7 @@
         }
     }
 
-    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 @@
     }
 
     //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;