From 74474750f1ac522730dae271a5ea5003caa8b73c Mon Sep 17 00:00:00 2001 From: Andreas Cadhalpun Date: Wed, 6 Jan 2016 14:09:22 +0100 Subject: [PATCH] asfdec_o: prevent overflow causing seekback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes infinite loops. Reviewed-by: Alexandra Hájková Signed-off-by: Andreas Cadhalpun --- libavformat/asfdec_o.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/asfdec_o.c b/libavformat/asfdec_o.c index bc168d3516..b81519fb18 100644 --- a/libavformat/asfdec_o.c +++ b/libavformat/asfdec_o.c @@ -167,7 +167,7 @@ static void swap_guid(ff_asf_guid guid) static void align_position(AVIOContext *pb, int64_t offset, uint64_t size) { - if (avio_tell(pb) != offset + size) + if (size < INT64_MAX - offset && avio_tell(pb) != offset + size) avio_seek(pb, offset + size, SEEK_SET); }