diff options
author | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-06-03 22:36:59 +0000 |
---|---|---|
committer | Baptiste Coudurier <baptiste.coudurier@gmail.com> | 2009-06-03 22:36:59 +0000 |
commit | 502d6c0a234b10f65acb0a203aedf14de70dc555 (patch) | |
tree | 53558cb623ce481b3a9e086a517ce41c168a20cd | |
parent | f4ebb334be7b9442099fdcee7fd3aaa7899404a6 (diff) | |
download | ffmpeg-502d6c0a234b10f65acb0a203aedf14de70dc555.tar.gz |
Change find_tag return type to int64_t, fix a bug
where size is negative and url_fseek then seek backward
causing infinite loop. This also support 4gb unsigned size.
Originally committed as revision 19083 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavformat/wav.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/libavformat/wav.c b/libavformat/wav.c index f9a3444d76..d0f1815e3f 100644 --- a/libavformat/wav.c +++ b/libavformat/wav.c @@ -118,11 +118,10 @@ static int wav_write_trailer(AVFormatContext *s) #endif /* CONFIG_WAV_MUXER */ /* return the size of the found tag */ -/* XXX: > 2GB ? */ -static int find_tag(ByteIOContext *pb, uint32_t tag1) +static int64_t find_tag(ByteIOContext *pb, uint32_t tag1) { unsigned int tag; - int size; + int64_t size; for(;;) { if (url_feof(pb)) @@ -133,8 +132,6 @@ static int find_tag(ByteIOContext *pb, uint32_t tag1) break; url_fseek(pb, size, SEEK_CUR); } - if (size < 0) - size = 0x7fffffff; return size; } @@ -161,7 +158,7 @@ static int wav_probe(AVProbeData *p) static int wav_read_header(AVFormatContext *s, AVFormatParameters *ap) { - int size; + int64_t size; unsigned int tag; ByteIOContext *pb = s->pb; AVStream *st; |