1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

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>
This commit is contained in:
Luca Barbato 2013-04-20 13:36:44 +02:00 committed by Diego Biurrun
parent 1c88617b94
commit 8e329dba37

View File

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