From 90b2f3136778311fb5e097b8ee1f527518231c23 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Mon, 18 Aug 2014 10:32:57 +0000 Subject: [PATCH] cafdec: check for eof in read_info_chunk() Fixes Ticket #3864 Found-by: Piotr Bandurski Signed-off-by: Paul B Mahol --- libavformat/cafdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index c797e20c09..e53102b368 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -205,7 +205,7 @@ static void read_info_chunk(AVFormatContext *s, int64_t size) AVIOContext *pb = s->pb; unsigned int i; unsigned int nb_entries = avio_rb32(pb); - for (i = 0; i < nb_entries; i++) { + for (i = 0; i < nb_entries && !avio_feof(pb); i++) { char key[32]; char value[1024]; avio_get_str(pb, INT_MAX, key, sizeof(key));