Module: libav
Branch: release/9
Commit: c046890191628b607e479e4845d48acc9c879143

Author:    Luca Barbato <[email protected]>
Committer: Reinhard Tartler <[email protected]>
Date:      Sat Apr 20 13:36:44 2013 +0200

riff: check for eof if chunk size and code are 0

Prevent an infinite loop.

Inspired by a patch from Michael Niedermayer

CC: [email protected]

Signed-off-by: Diego Biurrun <[email protected]>
(cherry picked from commit 8e329dba378cef0ff6400c7df9c51da167d5a1f0)

Signed-off-by: Reinhard Tartler <[email protected]>

---

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

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 79b2670..e9463c0 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -728,6 +728,10 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
         if (!chunk_code) {
             if (chunk_size)
                 avio_skip(pb, chunk_size);
+            else if (pb->eof_reached) {
+                av_log(s, AV_LOG_WARNING, "truncated file\n");
+                return AVERROR_EOF;
+            }
             continue;
         }
 

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

Reply via email to