From patchwork Mon Aug 17 12:30:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 21691 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 8E3F044A27F for ; Mon, 17 Aug 2020 15:30:35 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 6DFD868B7D5; Mon, 17 Aug 2020 15:30:35 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgsg2.qq.com (smtpbgsg2.qq.com [54.254.200.128]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3B53F68B7D5 for ; Mon, 17 Aug 2020 15:30:27 +0300 (EEST) X-QQ-mid: bizesmtp7t1597667420tw74bws8x Received: from localhost (unknown [103.107.216.230]) by esmtp6.qq.com (ESMTP) with id ; Mon, 17 Aug 2020 20:30:19 +0800 (CST) X-QQ-SSF: 01100000002000Z0Z000000A0000000 X-QQ-FEAT: Br92wPWbhadEfifW+gzSDkYGqhgHIyluxSClCuqXKXxWS2nbm2mPaHozInrc3 Cr6299mBfXJOIdXwLjSgmWmLRCcs8gzD4Dnaxvj3I81lcnAfFs1Th4CncX6oVMuwBI38bus 3FCpxO12JB4ZLIRm5ReCD/hqABq2LkLxtTQKqQjiwtnth/R+jQt6NFwz+E1+NmlapsRJX8m cWi5JLIa/IF1VYirijPo5TFP0w8oHumM4nB0sh/fJv0QbI2luR0WWl4cPgFmDF5mergGp9N pb7lcOvOKpvBKCPKw6N/uq2QFgRtf+imnIOSiqdRb6Sqc6EJB2N0KtYOu1//WmS7A/BdM8r 7BI3T4e X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Mon, 17 Aug 2020 20:30:18 +0800 Message-Id: <20200817123018.6898-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.25.0 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign5 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/dashdec: check the root url length X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Steven Liu Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" if the length of the root url is 0, unnecessary process the root_url Signed-off-by: Steven Liu --- libavformat/dashdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/dashdec.c b/libavformat/dashdec.c index c5a5ff607b..387d97fe42 100644 --- a/libavformat/dashdec.c +++ b/libavformat/dashdec.c @@ -776,7 +776,7 @@ static int resolve_content_path(AVFormatContext *s, const char *url, int *max_ur size = strlen(root_url); isRootHttp = ishttp(root_url); - if (root_url[size - 1] != token) { + if (size > 0 && root_url[size - 1] != token) { av_strlcat(root_url, "/", size + 2); size += 2; }