diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2022-03-02 13:01:53 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2022-04-06 20:27:35 +0200 |
commit | 338444c0161e044f1608b4f2780c619f1297512a (patch) | |
tree | c9cb458fc0df6c8da13ec5e399b0292cd914179d /libavformat | |
parent | 811047f7c26f88118ccd2c10c940b7b66b1ebf5d (diff) | |
download | ffmpeg-338444c0161e044f1608b4f2780c619f1297512a.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>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mov.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 4bd4750a21..46d8e628fd 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5124,6 +5124,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; |