diff options
author | Reinhard Tartler <siretart@tauware.de> | 2010-02-26 15:49:52 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-02-26 15:49:52 +0000 |
commit | a317cd572205ff3611e4da836f22b93e280221d2 (patch) | |
tree | 89402fb0d3e5746ea6ea8e079c395ca062a7800c | |
parent | 8e2149d7dfc6af6291d031baa57fa1e184a85a58 (diff) | |
download | ffmpeg-a317cd572205ff3611e4da836f22b93e280221d2.tar.gz |
Avoid divisions by 0 in the ASF demuxer if packet_size is not valid.
r19330 by reimar
Originally committed as revision 22080 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5
-rw-r--r-- | libavformat/asfdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 4d61739719..cb695c1a44 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -555,7 +555,9 @@ int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb) int rsize = 8; int c, d, e, off; - off= (url_ftell(pb) - s->data_offset) % asf->packet_size + 3; + off= 32768; + if (s->packet_size > 0) + off= (url_ftell(pb) - s->data_offset) % asf->packet_size + 3; c=d=e=-1; while(off-- > 0){ @@ -941,7 +943,8 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, start_pos[i]= pos; } - pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset; + if (s->packet_size > 0) + pos= (pos+asf->packet_size-1-s->data_offset)/asf->packet_size*asf->packet_size+ s->data_offset; *ppos= pos; url_fseek(s->pb, pos, SEEK_SET); |