Module: libav
Branch: release/9
Commit: 9486e98712879e1f3b2d83bbfc361e402b535005

Author:    Anton Khirnov <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Sat Aug 24 21:30:46 2013 +0200

ape demuxer: check for EOF in potentially long loops

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: [email protected]
(cherry-picked from commit 488b2984fece7ad0c2596826fee18e74aa904667)
Signed-off-by: Luca Barbato <[email protected]>

---

 libavformat/ape.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/libavformat/ape.c b/libavformat/ape.c
index d67e684..a9c695e 100644
--- a/libavformat/ape.c
+++ b/libavformat/ape.c
@@ -276,7 +276,9 @@ static int ape_read_header(AVFormatContext * s)
         ape->seektable = av_malloc(ape->seektablelength);
         if (!ape->seektable)
             return AVERROR(ENOMEM);
-        for (i = 0; i < ape->seektablelength / sizeof(uint32_t); i++)
+        for (i = 0;
+             i < ape->seektablelength / sizeof(uint32_t) && !pb->eof_reached;
+             i++)
             ape->seektable[i] = avio_rl32(pb);
     }
 

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to