summaryrefslogtreecommitdiff
path: root/libavformat/riff.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-22 11:07:50 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-22 11:46:22 +0200
commit369e5dcfc530576293998ea35137b8cc35aee412 (patch)
tree7708b4c12fa28cbcdbc15bc93f973c2d4cb09564 /libavformat/riff.c
parente381cc3e4ea61b5d42b45162ef6969a90a0507c9 (diff)
parent8e329dba378cef0ff6400c7df9c51da167d5a1f0 (diff)
Merge commit '8e329dba378cef0ff6400c7df9c51da167d5a1f0'
* commit '8e329dba378cef0ff6400c7df9c51da167d5a1f0': riff: check for eof if chunk size and code are 0 Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/riff.c')
-rw-r--r--libavformat/riff.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/riff.c b/libavformat/riff.c
index ff339ccb41..818ef55d98 100644
--- a/libavformat/riff.c
+++ b/libavformat/riff.c
@@ -880,7 +880,7 @@ int ff_read_riff_info(AVFormatContext *s, int64_t size)
av_log(s, AV_LOG_WARNING, "INFO subchunk truncated\n");
return AVERROR_INVALIDDATA;
}
- break;
+ return AVERROR_EOF;
}
if (chunk_size > end ||
end - chunk_size < cur ||
@@ -899,6 +899,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;
}