From aa180169961b46cf0d2bcc23cb686f93c079b256 Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Tue, 5 Jan 2016 13:20:11 +0100 Subject: [PATCH] asfdec_o: reject size > INT64_MAX in asf_read_unknown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both avio_skip and detect_unknown_subobject use int64_t for the size parameter. This fixes a segmentation fault due to infinite recursion. Reviewed-by: Alexandra Hájková Signed-off-by: Andreas Cadhalpun --- libavformat/asfdec_o.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index 79b9ee43cc..02809bb435 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -178,6 +178,9 @@ static int asf_read_unknown(AVFormatContext *s, const GUIDParseTable *g) uint64_t size = avio_rl64(pb); int ret; + if (size > INT64_MAX) + return AVERROR_INVALIDDATA; + if (asf->is_header) asf->unknown_size = size; asf->is_header = 0;