Commit d7bdab1a authored by Sean McGovern's avatar Sean McGovern

mov: log and return early on non-positive stsd entry counts

Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
parent b90fdb2c
...@@ -1875,6 +1875,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom) ...@@ -1875,6 +1875,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb24(pb); /* flags */ avio_rb24(pb); /* flags */
entries = avio_rb32(pb); entries = avio_rb32(pb);
if (entries <= 0) {
av_log(c->fc, AV_LOG_ERROR, "invalid STSD entries %d\n", entries);
return AVERROR_INVALIDDATA;
}
if (sc->extradata) { if (sc->extradata) {
av_log(c->fc, AV_LOG_ERROR, av_log(c->fc, AV_LOG_ERROR,
"Duplicate stsd found in this track.\n"); "Duplicate stsd found in this track.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment