diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-02-05 18:31:27 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-02-05 18:31:27 +0100 |
commit | a8343bfb6a3f00777943b94ff2969422f578f246 (patch) | |
tree | 3121c339d9e9a69e2846796adacac83efeac4178 | |
parent | 2b20397e1fbe52db800ef5deb810f7bc2602f248 (diff) | |
download | ffmpeg-a8343bfb6a3f00777943b94ff2969422f578f246.tar.gz |
riff: fix infinite loop
Fixes Ticket2241
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/riff.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index 508beb1f0b..0df5c8c7e3 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -818,7 +818,13 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) chunk_code = avio_rl32(pb); chunk_size = avio_rl32(pb); - + if (url_feof(pb)) { + if (chunk_code || chunk_size) { + av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n"); + return AVERROR_INVALIDDATA; + } + break; + } if (chunk_size > end || end - chunk_size < cur || chunk_size == UINT_MAX) { avio_seek(pb, -9, SEEK_CUR); chunk_code = avio_rl32(pb); |