[FFmpeg-cvslog] cafdec: check for eof in read_info_chunk()

Paul B Mahol git at videolan.org
Mon Aug 18 12:35:54 CEST 2014


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon Aug 18 10:32:57 2014 +0000| [90b2f3136778311fb5e097b8ee1f527518231c23] | committer: Paul B Mahol

cafdec: check for eof in read_info_chunk()

Fixes Ticket #3864
Found-by: Piotr Bandurski <ami_stuff at o2.pl>
Signed-off-by: Paul B Mahol <onemda at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=90b2f3136778311fb5e097b8ee1f527518231c23
---

 libavformat/cafdec.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index c797e20..e53102b 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));



More information about the ffmpeg-cvslog mailing list