diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index a17c953f06..107ec7a315 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -985,6 +985,9 @@ static int asf_read_simple_index(AVFormatContext *s, const GUIDParseTable *g) int i, ret; uint64_t size = avio_rl64(pb); + if (size < 24) + return AVERROR_INVALIDDATA; + // simple index objects should be ordered by stream number, this loop tries to find // the first not indexed video stream for (i = 0; i < asf->nb_streams; i++) {