mirror of https://git.ffmpeg.org/ffmpeg.git
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>
(cherry picked from commit 8e329dba37
)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
This commit is contained in:
parent
d70bad04de
commit
c046890191
|
@ -728,6 +728,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue