summaryrefslogtreecommitdiff
path: root/libavformat
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2016-07-26 11:42:11 +0200
committerDiego Biurrun <diego@biurrun.de>2016-07-29 18:46:48 +0200
commit2ac00d2d1d51047c6ce69d5fbe1a08392d142658 (patch)
treead4bcc09904a5531358ae9cb783d97d0ded62623 /libavformat
parenta115eb9e750543f1d8bf951414d291069bf396c2 (diff)
mov: Validate the ID number
IDs in MOV start from 1. Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index ff39b58ef1..03427d7e06 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -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;