diff options
author | Reinhard Tartler <siretart@tauware.de> | 2010-05-19 11:44:45 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2010-05-19 11:44:45 +0000 |
commit | ba9cecf5e5eeb9191452ca52cf47f57484d2a4a1 (patch) | |
tree | c23082b3e36d97056b7ec3f2e5cecd783ff42de2 | |
parent | 8ab1409a59fcb972ba1476312d8d3c5bc788323e (diff) |
Favor chunk size over hitting the correct position after reading the chunk size in asf.
Fixes issue1923
backport r23040 by michael
Originally committed as revision 23185 to svn://svn.ffmpeg.org/ffmpeg/branches/0.6
-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 bbc27305e2..8aea8c7ef6 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -204,9 +204,10 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) get_byte(pb); memset(&asf->asfid2avid, -1, sizeof(asf->asfid2avid)); for(;;) { + uint64_t gpos= url_ftell(pb); get_guid(pb, &g); gsize = get_le64(pb); - dprintf(s, "%08"PRIx64": ", url_ftell(pb) - 24); + dprintf(s, "%08"PRIx64": ", gpos); print_guid(&g); dprintf(s, " size=0x%"PRIx64"\n", gsize); if (!guidcmp(&g, &ff_asf_data_header)) { @@ -584,8 +585,10 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) av_log(s, AV_LOG_WARNING, "Digital signature detected, decoding will likely fail!\n"); } } - url_fseek(pb, gsize - 24, SEEK_CUR); } + if(url_ftell(pb) != gpos + gsize) + av_log(s, AV_LOG_DEBUG, "gpos mismatch our pos=%"PRIu64", end=%"PRIu64"\n", url_ftell(pb)-gpos, gsize); + url_fseek(pb, gpos + gsize, SEEK_SET); } get_guid(pb, &g); get_le64(pb); |