summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-02 13:01:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-09 22:19:40 +0200
commit5a67ee57970b198d0417af30ca8a21ca6cd98d38 (patch)
treed913e38f869a817f74d090560d13c57fed31ff45
parent34b6731e78355b649a2082d7e75fe559b14e1798 (diff)
downloadffmpeg-5a67ee57970b198d0417af30ca8a21ca6cd98d38.tar.gz
avformat/mov: Disallow empty sidx
It appears this is not allowed "Each Segment Index box documents how a (sub)segment is divided into one or more subsegments (which may themselves be further subdivided using Segment Index boxes)." Fixes: Null pointer dereference Fixes: Ticket9517 Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 4419433d77278cb742944c4514be5f72a04103c0) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 67dcbd5b7a..24c85e43bb 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5041,6 +5041,8 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_rb16(pb); // reserved
item_count = avio_rb16(pb);
+ if (item_count == 0)
+ return AVERROR_INVALIDDATA;
for (i = 0; i < item_count; i++) {
int index;