diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index 656b473140..1557391ef3 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -326,6 +326,10 @@ static void read_info_chunk(AVFormatContext *s, int64_t size) AVIOContext *pb = s->pb; unsigned int i; unsigned int nb_entries = avio_rb32(pb); + + if (3LL * nb_entries > size) + return; + for (i = 0; i < nb_entries && !avio_feof(pb); i++) { char key[32]; char value[1024];