diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2013-04-20 13:36:44 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-04-21 18:20:30 +0200 |
commit | 8e329dba378cef0ff6400c7df9c51da167d5a1f0 (patch) | |
tree | 9ca286eda77fa35fcf29b994b970d522882e81b4 | |
parent | 1c88617b9421c9af8ae961c05d2381b19c585026 (diff) | |
download | ffmpeg-8e329dba378cef0ff6400c7df9c51da167d5a1f0.tar.gz |
riff: check for eof if chunk size and code are 0
Prevent an infinite loop.
Inspired by a patch from Michael Niedermayer
CC: libav-stable@libav.org
Signed-off-by: Diego Biurrun <diego@biurrun.de>
-rw-r--r-- | libavformat/riff.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c index 694d299ecf..2191c3395d 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -785,6 +785,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; } |