Commit 369e5dcf authored by Michael Niedermayer's avatar Michael Niedermayer

Merge commit '8e329dba'

* commit '8e329dba':
  riff: check for eof if chunk size and code are 0
Merged-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parents e381cc3e 8e329dba
...@@ -880,7 +880,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) ...@@ -880,7 +880,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n"); av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n");
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
break; return AVERROR_EOF;
} }
if (chunk_size > end || if (chunk_size > end ||
end - chunk_size < cur || end - chunk_size < cur ||
...@@ -899,6 +899,10 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size) ...@@ -899,6 +899,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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment