Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2022-03-02 15:01:53 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-04-07 17:27:00 +0300
commita09bc161b065427f018a350386260fcc2edad1c6 (patch)
tree3be6c8bb4be3250c4f22c7395ac0bb17f8d7f9ca /libavformat
parent084b4f82a37d0f065f98701214ede7d3cdff87f2 (diff)
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>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/mov.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 93263c2d9e..8698b85e92 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -5039,6 +5039,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;