# HG changeset patch # User michael # Date 1173584177 0 # Node ID 6d2157d1fc93cd1f7872d12fa0cd5a7a7c138320 # Parent 87148b96d6498d85728aefebfe098bb7b831df7c fix gsize=0 / -1 case (if(<24) goto fail) before it is not a good idea diff -r 87148b96d649 -r 6d2157d1fc93 asf.c --- a/asf.c Sun Mar 11 02:51:06 2007 +0000 +++ b/asf.c Sun Mar 11 03:36:17 2007 +0000 @@ -167,6 +167,16 @@ print_guid(&g); printf(" size=0x%"PRIx64"\n", gsize); #endif + if (!memcmp(&g, &data_header, sizeof(GUID))) { + asf->data_object_offset = url_ftell(pb); + // if not streaming, gsize is not unlimited (how?), and there is enough space in the file.. + if (!(asf->hdr.flags & 0x01) && gsize >= 100) { + asf->data_object_size = gsize - 24; + } else { + asf->data_object_size = (uint64_t)-1; + } + break; + } if (gsize < 24) goto fail; if (!memcmp(&g, &file_header, sizeof(GUID))) { @@ -327,15 +337,6 @@ } pos2 = url_ftell(pb); url_fskip(pb, gsize - (pos2 - pos1 + 24)); - } else if (!memcmp(&g, &data_header, sizeof(GUID))) { - asf->data_object_offset = url_ftell(pb); - // if not streaming, gsize is not unlimited (how?), and there is enough space in the file.. - if (!(asf->hdr.flags & 0x01) && gsize != (uint64_t)-1 && gsize >= 24) { - asf->data_object_size = gsize - 24; - } else { - asf->data_object_size = (uint64_t)-1; - } - break; } else if (!memcmp(&g, &comment_header, sizeof(GUID))) { int len1, len2, len3, len4, len5;