aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author孙浩 and 张洪亮(望初) <tony.sh and wangchu.zhl@alibaba-inc.com>2017-08-25 01:15:27 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-28 01:42:26 +0200
commit983f90ef1819a0d4d3a5685b8a617a18eaecbd4b (patch)
tree89a0e08a7f723a347e1b50512a34c452a4cf0628
parente7dc286b16ab54342e0b415abb4dc4e0cc22f736 (diff)
downloadffmpeg-983f90ef1819a0d4d3a5685b8a617a18eaecbd4b.tar.gz
avformat/cinedec: Fix DoS due to lack of eof check
Fixes: loop.cine Found-by: Xiaohei and Wangchu from Alibaba Security Team Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7e80b63ecd259d69d383623e75b318bf2bd491f6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/cinedec.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c
index 0583ce020a..22af00771c 100644
--- a/libavformat/cinedec.c
+++ b/libavformat/cinedec.c
@@ -267,8 +267,12 @@ static int cine_read_header(AVFormatContext *avctx)
/* parse image offsets */
avio_seek(pb, offImageOffsets, SEEK_SET);
- for (i = 0; i < st->duration; i++)
+ for (i = 0; i < st->duration; i++) {
+ if (avio_feof(pb))
+ return AVERROR_INVALIDDATA;
+
av_add_index_entry(st, avio_rl64(pb), i, 0, 0, AVINDEX_KEYFRAME);
+ }
return 0;
}