Skip to content
Snippets Groups Projects
Commit 8e329dba authored by Luca Barbato's avatar Luca Barbato Committed by Diego Biurrun
Browse files

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: default avatarDiego Biurrun <diego@biurrun.de>
parent 1c88617b
No related branches found
No related tags found
No related merge requests found
...@@ -785,6 +785,10 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) ...@@ -785,6 +785,10 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
if (!chunk_code) { if (!chunk_code) {
if (chunk_size) if (chunk_size)
avio_skip(pb, 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; continue;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment