[FFmpeg-cvslog] avformat/mov: Disallow empty sidx
Michael Niedermayer
git at videolan.org
Sat Apr 23 18:45:33 EEST 2022
ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Wed Mar 2 13:01:53 2022 +0100| [81e99640d5e7ba09576ce8cf40de180b946550d6] | committer: Michael Niedermayer
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 at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 4419433d77278cb742944c4514be5f72a04103c0)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=81e99640d5e7ba09576ce8cf40de180b946550d6
---
libavformat/mov.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 94b2c079e3..e225dde84b 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3698,7 +3698,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
index->track_id = track_id;
index->item_count = avio_rb16(pb);
- index->items = av_mallocz_array(index->item_count, sizeof(MOVFragmentIndexItem));
+ index->items = index->item_count ? av_mallocz_array(index->item_count, sizeof(MOVFragmentIndexItem)) : NULL;
if (!index->items) {
av_freep(&index);
More information about the ffmpeg-cvslog
mailing list