diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-10-18 06:58:20 +0400 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-12-10 03:50:04 +0400 |
commit | 455b98b7775c68fd02adbeec9681e35ad725a838 (patch) | |
tree | 7a3350504f12b8eb8fcf438ed91acd4eb537155c | |
parent | e9aeab39098936f53cc955c8175bb7ade504fb8d (diff) |
riff: retry reading metadata without padding if it fails with
Fixes Ticket1821
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit d0c27e88d2bb495d61bd32f41769f767a0c2a802)
-rw-r--r-- | libavformat/riff.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index 74f384d268..59dd5df711 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -701,8 +701,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); |