mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
avformat/mov: check for duplicate stsd before changing state
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
committed by
michaelni
parent
613925a96e
commit
8d3b044f84
@@ -3209,6 +3209,12 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
st = c->fc->streams[c->fc->nb_streams - 1];
|
||||
sc = st->priv_data;
|
||||
|
||||
if (sc->extradata) {
|
||||
av_log(c->fc, AV_LOG_ERROR,
|
||||
"Duplicate stsd found in this track.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
sc->stsd_version = avio_r8(pb);
|
||||
avio_rb24(pb); /* flags */
|
||||
entries = avio_rb32(pb);
|
||||
@@ -3219,12 +3225,6 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
if (sc->extradata) {
|
||||
av_log(c->fc, AV_LOG_ERROR,
|
||||
"Duplicate stsd found in this track.\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
/* Prepare space for hosting multiple extradata. */
|
||||
sc->extradata = av_calloc(entries, sizeof(*sc->extradata));
|
||||
if (!sc->extradata)
|
||||
|
||||
Reference in New Issue
Block a user