aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/riff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-10-18 04:58:20 +0200
committerMichael Niedermayer <michaelni@gmx.at>2012-10-18 16:03:16 +0200
commitd0c27e88d2bb495d61bd32f41769f767a0c2a802 (patch)
tree993eab9c24b5c7d95e6288c530bcef08c51d1218 /libavformat/riff.c
parent1350dffdc6ad27f604ed4cb3c8a6af3c005c3483 (diff)
downloadffmpeg-d0c27e88d2bb495d61bd32f41769f767a0c2a802.tar.gz
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>
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r--libavformat/riff.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index ee3542ca0f..769a4d6ba5 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);