From patchwork Tue Nov 13 02:42:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 11010 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 EC68144E097 for ; Tue, 13 Nov 2018 04:42:35 +0200 (EET) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 58C8C68A273; Tue, 13 Nov 2018 04:42:07 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbgeu2.qq.com (smtpbgeu2.qq.com [18.194.254.142]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 72246689AF7 for ; Tue, 13 Nov 2018 04:42:00 +0200 (EET) X-QQ-mid: bizesmtp10t1542076952t6y1lsa5 Received: from localhost (unknown [106.2.229.242]) by esmtp10.qq.com (ESMTP) with id ; Tue, 13 Nov 2018 10:42:31 +0800 (CST) X-QQ-SSF: 01100000002000F0FMF0000A0000000 X-QQ-FEAT: y3TlQFRJ9VYSkoLGxIkm6wBwf6X+nvDUHxRIGQl7PjEukRIfbQ3VGKcYPShwO EsDSOEiPjhxOYC/zCcRq2tTeQotxEeMCFxUXzlpm6PmyIi5szplkTSGJD31h0FN3G8pYfgw K8W8Swqt/Nlb0qrLngmxT1ZcXPv0Ak/FL+WXPZL4mnWhF+11zMAK+D5ueTNEXlT9F/kMZLO 8LqmdRvfW5qR2sB8IBdWQwDCB5+Jyo4ZFsS7aR5FZOEhF1471hA7PcHcsAJ7EjCqfBbSpkL kuY8XqOyinJlb38bfzULHWFZmgLsQaSRRIBw== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Tue, 13 Nov 2018 10:42:27 +0800 Message-Id: <20181113024227.95249-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.15.2 (Apple Git-101.1) X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign1 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: remove the cannot reach result 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" fix CID: 1441166 because the logic have checked the vtt_dirname before Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index e0048aa9d8..8a687dc1bb 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -507,7 +507,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls, } p = (char *)av_basename(vtt_dirname); *p = '\0'; - sub_path_size = strlen(segment->sub_filename) + 1 + (vtt_dirname ? strlen(vtt_dirname) : 0); + sub_path_size = strlen(segment->sub_filename) + 1 + strlen(vtt_dirname); sub_path = av_malloc(sub_path_size); if (!sub_path) { ret = AVERROR(ENOMEM);