Commit 2ac00d2d authored by Luca Barbato's avatar Luca Barbato Committed by Diego Biurrun

mov: Validate the ID number

IDs in MOV start from 1.
Signed-off-by: 's avatarDiego Biurrun <diego@biurrun.de>
parent a115eb9e
......@@ -1949,8 +1949,8 @@ static int mov_read_stsc(MOVContext *c, AVIOContext *pb, MOVAtom atom)
sc->stsc_data[i].first = avio_rb32(pb);
sc->stsc_data[i].count = avio_rb32(pb);
sc->stsc_data[i].id = avio_rb32(pb);
if (sc->stsc_data[i].id < 0 || sc->stsc_data[i].id > sc->stsd_count) {
sc->stsc_data[i].id = 0;
if (sc->stsc_data[i].id <= 0 || sc->stsc_data[i].id > sc->stsd_count) {
sc->stsc_data[i].id = 1;
if (c->fc->error_recognition & AV_EF_EXPLODE) {
av_log(c->fc, AV_LOG_ERROR, "Invalid stsc index.\n");
return AVERROR_INVALIDDATA;
......
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