Commit 8e329dba authored by Luca Barbato's avatar Luca Barbato Committed by Diego Biurrun

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: 's avatarDiego Biurrun <diego@biurrun.de>
parent 1c88617b
......@@ -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;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment