aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-02 13:01:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2022-03-28 23:18:56 +0200
commitf87f1005582dee59b51eda461cb7fa8b3098de1a (patch)
treec46faccd07ca9f4154c2d31d1250db4c76b3c33d
parent5c4fdf111e88be8fd5dfcfe7a3f91e8afd68925d (diff)
downloadffmpeg-f87f1005582dee59b51eda461cb7fa8b3098de1a.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 4aa77a318e..6fb09df7e1 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5118,6 +5118,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;