diff --git a/libavformat/mov.c b/libavformat/mov.c index 67dcbd5b7a..24c85e43bb 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -5041,6 +5041,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;