[FFmpeg-cvslog] riff: retry reading metadata without padding if it fails with

Michael Niedermayer git at videolan.org
Mon Dec 10 00:55:16 CET 2012


ffmpeg | branch: release/1.0 | Michael Niedermayer <michaelni at gmx.at> | Thu Oct 18 04:58:20 2012 +0200| [15526ac69f14baef857c8bcf84f1f5790548e6dd] | committer: Carl Eugen Hoyos

riff: retry reading metadata without padding if it fails with

Fixes Ticket1821

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
(cherry picked from commit d0c27e88d2bb495d61bd32f41769f767a0c2a802)

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

 libavformat/riff.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/libavformat/riff.c b/libavformat/riff.c
index 1c34112..06e69c4 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -771,8 +771,13 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
         chunk_code = avio_rl32(pb);
         chunk_size = avio_rl32(pb);
         if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
-            av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
-            return AVERROR_INVALIDDATA;
+            avio_seek(pb, -9, SEEK_CUR);
+            chunk_code = avio_rl32(pb);
+            chunk_size = avio_rl32(pb);
+            if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) {
+                av_log(s, AV_LOG_ERROR, "too big INFO subchunk\n");
+                return AVERROR_INVALIDDATA;
+            }
         }
 
         chunk_size += (chunk_size & 1);



More information about the ffmpeg-cvslog mailing list