Browse Source

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>
tags/n2.0
Luca Barbato Diego Biurrun 12 years ago
parent
commit
8e329dba37
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavformat/riff.c

+ 4
- 0
libavformat/riff.c View File

@@ -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;
}



Loading…
Cancel
Save