[FFmpeg-cvslog] r19330 - trunk/libavformat/asfdec.c

reimar subversion
Fri Jul 3 13:18:07 CEST 2009


Author: reimar
Date: Fri Jul  3 13:18:07 2009
New Revision: 19330

Log:
Avoid divisions by 0 in the ASF demuxer if packet_size is not valid.

Modified:
   trunk/libavformat/asfdec.c

Modified: trunk/libavformat/asfdec.c
==============================================================================
--- trunk/libavformat/asfdec.c	Fri Jul  3 13:14:37 2009	(r19329)
+++ trunk/libavformat/asfdec.c	Fri Jul  3 13:18:07 2009	(r19330)
@@ -595,6 +595,9 @@ static int ff_asf_get_packet(AVFormatCon
     int rsize = 8;
     int c, d, e, off;
 
+    // if we do not know packet size, allow skipping up to 32 kB
+    off= 32768;
+    if (s->packet_size > 0)
     off= (url_ftell(pb) - s->data_offset) % s->packet_size + 3;
 
     c=d=e=-1;
@@ -989,6 +992,7 @@ static int64_t asf_read_pts(AVFormatCont
         start_pos[i]= pos;
     }
 
+    if (s->packet_size > 0)
     pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
     *ppos= pos;
     url_fseek(s->pb, pos, SEEK_SET);



More information about the ffmpeg-cvslog mailing list