mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-13 21:28:01 +02:00
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 4419433d77
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
77f3f2aaf9
commit
b70429e33c
@ -4586,7 +4586,7 @@ static int mov_read_sidx(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
|||||||
index->track_id = track_id;
|
index->track_id = track_id;
|
||||||
|
|
||||||
index->item_count = avio_rb16(pb);
|
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) {
|
if (!index->items) {
|
||||||
av_freep(&index);
|
av_freep(&index);
|
||||||
|
Loading…
Reference in New Issue
Block a user