avformat/mov: Ignore duplicate ftyp

Fixes: switch_1080p_720p.mp4
Found-by: Dale Curtis <dalecurtis@chromium.org>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2023-12-02 00:26:03 +01:00
parent b60d39fbe2
commit 4cdf2c7f76
No known key found for this signature in database
GPG Key ID: B18E8928B3948D64
1 changed files with 6 additions and 2 deletions

View File

@ -1222,8 +1222,12 @@ static int mov_read_ftyp(MOVContext *c, AVIOContext *pb, MOVAtom atom)
int ret = ffio_read_size(pb, type, 4);
if (ret < 0)
return ret;
if (c->fc->nb_streams)
return AVERROR_INVALIDDATA;
if (c->fc->nb_streams) {
if (c->fc->strict_std_compliance >= FF_COMPLIANCE_STRICT)
return AVERROR_INVALIDDATA;
av_log(c->fc, AV_LOG_DEBUG, "Ignoring duplicate FTYP\n");
return 0;
}
if (strcmp(type, "qt "))
c->isom = 1;