diff --git a/libavformat/riff.c b/libavformat/riff.c index 79b2670481..e9463c0973 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -728,6 +728,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; }