Commit 51e226a7 authored by reimar's avatar reimar

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


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@19330 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2fa98a89
...@@ -595,6 +595,9 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb) ...@@ -595,6 +595,9 @@ static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
int rsize = 8; int rsize = 8;
int c, d, e, off; 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; off= (url_ftell(pb) - s->data_offset) % s->packet_size + 3;
c=d=e=-1; c=d=e=-1;
...@@ -989,6 +992,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos, ...@@ -989,6 +992,7 @@ static int64_t asf_read_pts(AVFormatContext *s, int stream_index, int64_t *ppos,
start_pos[i]= pos; 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; pos= (pos+s->packet_size-1-s->data_offset)/s->packet_size*s->packet_size+ s->data_offset;
*ppos= pos; *ppos= pos;
url_fseek(s->pb, pos, SEEK_SET); url_fseek(s->pb, pos, SEEK_SET);
......
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