OSDN Git Service
(root)
/
coroid
/
libav_saccubus.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0410ee8
)
Avoid divisions by 0 in the ASF demuxer if packet_size is not valid.
author
Reimar Döffinger
<Reimar.Doeffinger@gmx.de>
Fri, 3 Jul 2009 11:18:07 +0000
(11:18 +0000)
committer
Reimar Döffinger
<Reimar.Doeffinger@gmx.de>
Fri, 3 Jul 2009 11:18:07 +0000
(11:18 +0000)
Originally committed as revision 19330 to svn://svn.ffmpeg.org/ffmpeg/trunk
libavformat/asfdec.c
patch
|
blob
|
history
diff --git
a/libavformat/asfdec.c
b/libavformat/asfdec.c
index
c294ff5
..
4869e55
100644
(file)
--- a/
libavformat/asfdec.c
+++ b/
libavformat/asfdec.c
@@
-595,6
+595,9
@@
static int ff_asf_get_packet(AVFormatContext *s, ByteIOContext *pb)
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(AVFormatContext *s, int stream_index, int64_t *ppos,
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);