# HG changeset patch # User bcoudurier # Date 1244068619 0 # Node ID 4da68099d1807f2780c3607ac3661118d706fa3f # Parent e57ded024980904238d61b1f9e9f9e19e300fd18 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. diff -r e57ded024980 -r 4da68099d180 wav.c --- a/wav.c Tue Jun 02 07:53:44 2009 +0000 +++ b/wav.c Wed Jun 03 22:36:59 2009 +0000 @@ -118,11 +118,10 @@ #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 @@ break; url_fseek(pb, size, SEEK_CUR); } - if (size < 0) - size = 0x7fffffff; return size; } @@ -161,7 +158,7 @@ static int wav_read_header(AVFormatContext *s, AVFormatParameters *ap) { - int size; + int64_t size; unsigned int tag; ByteIOContext *pb = s->pb; AVStream *st;