From patchwork Thu Oct 10 03:40:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steven Liu X-Patchwork-Id: 15658 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 C1CC344A020 for ; Thu, 10 Oct 2019 06:40:36 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id ADD7F6881A8; Thu, 10 Oct 2019 06:40:36 +0300 (EEST) 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 1DFE2688100 for ; Thu, 10 Oct 2019 06:40:30 +0300 (EEST) X-QQ-mid: bizesmtp25t1570678825txxycdf0 Received: from localhost (unknown [47.90.47.25]) by esmtp10.qq.com (ESMTP) with id ; Thu, 10 Oct 2019 11:40:25 +0800 (CST) X-QQ-SSF: 01100000002000K0ZRF1000A0000000 X-QQ-FEAT: p/Y2uUKTrsxgXvhOSdFd4L2k7NEcKp0xCuiO614+B/5UYnGkDXHN5G6jx3JuP WCvg/RkRscnLhlge6nh74/ZKpDYEuFRyADm/CGRWF2SKKuoGihXmQWa8rGiyrBcNqOZvuVT I1P8S7leGkC22DloFMILoGVAfBBMOqao9/B+n+jvUhzT4Kc9M5zRmOA0pQVw5mcCPwSx8HA ZpUfjKAnjLS3xAFfqD3/DW1lQdsczEC/LcvVbmaQVZDy518002OGgEqxtFYKOCYeQQ4sf3z ozf5i05QRfwEJcWrQYCF6n7am36z2su70F8TxHUgbqqVpWvKAN938Rs0wIS5Py0HT9yB6Y/ BTszG2Q X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Thu, 10 Oct 2019 11:40:06 +0800 Message-Id: <20191010034011.1205-3-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty In-Reply-To: <20191010034011.1205-1-lq@chinaffmpeg.org> References: <20191010034011.1205-1-lq@chinaffmpeg.org> X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:chinaffmpeg.org:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH v1 3/8] avformat/hlsenc: check av_strdup() return value 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" Signed-off-by: Steven Liu --- libavformat/hlsenc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index eacc438e30..fcc154013c 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2008,6 +2008,9 @@ static int parse_cc_stream_mapstring(AVFormatContext *s) ClosedCaptionsStream *ccs; p = av_strdup(hls->cc_stream_map); + if(!p) + return AVERROR(ENOMEM); + q = p; while (av_strtok(q, " \t", &saveptr1)) { q = NULL;