[FFmpeg-cvslog] avformat/cinedec: Fix DoS due to lack of eof check
孙浩 and 张洪亮(望初)
git at videolan.org
Sat Sep 2 03:30:42 EEST 2017
ffmpeg | branch: release/2.8 | 孙浩 and 张洪亮(望初) <tony.sh and wangchu.zhl at alibaba-inc.com> | Fri Aug 25 01:15:27 2017 +0200| [c70fdd9948085a72c8f622c6e22d9349cbf0bc75] | committer: Michael Niedermayer
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 at niedermayer.cc>
(cherry picked from commit 7e80b63ecd259d69d383623e75b318bf2bd491f6)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c70fdd9948085a72c8f622c6e22d9349cbf0bc75
---
libavformat/cinedec.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/libavformat/cinedec.c b/libavformat/cinedec.c
index 632f46c454..1497842cf2 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;
}
More information about the ffmpeg-cvslog
mailing list