From 41fb11551d8f18cdf05f9f11a403cefbaf38f57f Mon Sep 17 00:00:00 2001 From: Markus Koschany Date: Wed, 31 Jan 2018 14:48:32 +0100 Subject: [PATCH] CVE-2017-14057 Origin: https://github.com/FFmpeg/FFmpeg/commit/7f9ec5593e04827249e7aeb466da06a98a0d7329 Gbp-Pq: Name CVE-2017-14057.patch --- libavformat/asfdec.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 85e800d..1ec36aa 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -683,13 +683,15 @@ static int asf_read_marker(AVFormatContext *s, int64_t size) count = avio_rl32(pb); // markers count avio_rl16(pb); // reserved 2 bytes name_len = avio_rl16(pb); // name length - for (i = 0; i < name_len; i++) - avio_r8(pb); // skip the name + avio_skip(pb, name_len); for (i = 0; i < count; i++) { int64_t pres_time; int name_len; + if (avio_feof(pb)) + return AVERROR_INVALIDDATA; + avio_rl64(pb); // offset, 8 bytes pres_time = avio_rl64(pb); // presentation time pres_time -= asf->hdr.preroll * 10000; -- 2.30.2