Unified · Split
| @@ -7691,12 +7691,12 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 7690 unmodified lines | ||
| 7691 | 7691 | atom.size = INT64_MAX; |
| 7692 | 7692 | while (total_size <= atom.size - 8 && !avio_feof(pb)) { |
| 7693 | 7693 | int (*parse)(MOVContext*, AVIOContext*, MOVAtom) = NULL; |
| 7694 | − a.size = avio_rb32(pb); | |
| 7695 | − a.type = avio_rl32(pb); | |
| 7696 | − if (((a.type == MKTAG('f','r','e','e') && c->moov_retry) || | |
| 7697 | − a.type == MKTAG('h','o','o','v')) && | |
| 7698 | − a.size >= 8 && | |
| 7699 | − c->fc->strict_std_compliance < FF_COMPLIANCE_STRICT) { | |
| 7694 | + a.size = avio_rb32(pb); | |
| 7695 | + a.type = avio_rl32(pb); | |
| 7696 | + if (((a.type == MKTAG('f','r','e','e') && c->moov_retry) || | |
| 7697 | + a.type == MKTAG('h','o','o','v')) && | |
| 7698 | + a.size >= 8 && | |
| 7699 | + c->fc->strict_std_compliance < FF_COMPLIANCE_STRICT) { | |
| 7700 | 7700 | uint32_t type; |
| 7701 | 7701 | avio_skip(pb, 4); |
| 7702 | 7702 | type = avio_rl32(pb); |
| @@ -7708,22 +7708,22 @@ static int mov_read_default(MOVContext *c, AVIOContext *pb, MOVAtom atom) · 5 unmodified lines | ||
| 7708 | 7708 | av_log(c->fc, AV_LOG_ERROR, "Detected moov in a free or hoov atom.\n"); |
| 7709 | 7709 | a.type = MKTAG('m','o','o','v'); |
| 7710 | 7710 | } |
| 7711 | + } | |
| 7712 | + if (atom.type != MKTAG('r','o','o','t') && | |
| 7713 | + atom.type != MKTAG('m','o','o','v')) { | |
| 7714 | + if (a.type == MKTAG('t','r','a','k') || | |
| 7715 | + a.type == MKTAG('m','d','a','t')) { | |
| 7716 | + av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n"); | |
| 7717 | + avio_skip(pb, -8); | |
| 7718 | + c->atom_depth --; | |
| 7719 | + return 0; | |
| 7711 | 7720 | } |
| 7712 | − if (atom.type != MKTAG('r','o','o','t') && | |
| 7713 | − atom.type != MKTAG('m','o','o','v')) { | |
| 7714 | − if (a.type == MKTAG('t','r','a','k') || | |
| 7715 | − a.type == MKTAG('m','d','a','t')) { | |
| 7716 | − av_log(c->fc, AV_LOG_ERROR, "Broken file, trak/mdat not at top-level\n"); | |
| 7717 | − avio_skip(pb, -8); | |
| 7718 | − c->atom_depth --; | |
| 7719 | − return 0; | |
| 7720 | − } | |
| 7721 | − } | |
| 7721 | + } | |
| 7722 | + total_size += 8; | |
| 7723 | + if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */ | |
| 7724 | + a.size = avio_rb64(pb) - 8; | |
| 7722 | 7725 | total_size += 8; |
| 7723 | − if (a.size == 1 && total_size + 8 <= atom.size) { /* 64 bit extended size */ | |
| 7724 | − a.size = avio_rb64(pb) - 8; | |
| 7725 | − total_size += 8; | |
| 7726 | − } | |
| 7726 | + } | |
| 7727 | 7727 | av_log(c->fc, AV_LOG_TRACE, "type:'%s' parent:'%s' sz: %"PRId64" %"PRId64" %"PRId64"\n", |
| 7728 | 7728 | av_fourcc2str(a.type), av_fourcc2str(atom.type), a.size, total_size, atom.size); |
| 7729 | 7729 | if (a.size == 0) { |