1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-28 20:53:54 +02:00

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

Based on an FFmpeg patch by Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Sean McGovern 2017-07-28 16:17:33 -04:00
parent b90fdb2c71
commit d7bdab1ad7

View File

@ -1875,6 +1875,11 @@ static int mov_read_stsd(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb24(pb); /* flags */
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) {
av_log(c->fc, AV_LOG_ERROR,
"Duplicate stsd found in this track.\n");