diff --git a/libavformat/riff.c b/libavformat/riff.c index 694d299ecf..2191c3395d 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -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; }