diff --git a/libavformat/mov.c b/libavformat/mov.c index 11bcff035c89be9d2546cad9bf4508869864669f..5c9f85c738da6678e74eb99ba921f26985a20a4b 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1911,6 +1911,12 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) avio_rb24(pb); /* flags */ entries = avio_rb32(pb); + 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_mallocz_array(entries, sizeof(*sc->extradata)); if (!sc->extradata)