[FFmpeg-cvslog] r14714 - trunk/libavformat/utils.c
    bcoudurier 
    subversion
       
    Tue Aug 12 19:26:36 CEST 2008
    
    
  
Author: bcoudurier
Date: Tue Aug 12 19:26:36 2008
New Revision: 14714
Log:
Prevent dts generation code to be executed when delay is > MAX_REORDER_DELAY,
this fixes overflow in AVStream->pts_buffer.
Modified:
   trunk/libavformat/utils.c
Modified: trunk/libavformat/utils.c
==============================================================================
--- trunk/libavformat/utils.c	(original)
+++ trunk/libavformat/utils.c	Tue Aug 12 19:26:36 2008
@@ -895,7 +895,7 @@ static void compute_pkt_fields(AVFormatC
         }
     }
 
-    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 
     }
 
     //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;
    
    
More information about the ffmpeg-cvslog
mailing list