From patchwork Mon Feb 20 09:03:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Steven X-Patchwork-Id: 2610 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.22 with SMTP id n22csp761097vsb; Mon, 20 Feb 2017 01:04:38 -0800 (PST) X-Received: by 10.28.87.19 with SMTP id l19mr18031355wmb.95.1487581478403; Mon, 20 Feb 2017 01:04:38 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id b21si23145300wrd.60.2017.02.20.01.04.36; Mon, 20 Feb 2017 01:04:38 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 55472689BB3; Mon, 20 Feb 2017 11:04:25 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from smtpbg292.qq.com (smtpbg292.qq.com [113.108.11.231]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id BE36F689B6A for ; Mon, 20 Feb 2017 11:04:17 +0200 (EET) X-QQ-mid: bizesmtp15t1487581412t9rlkfy7 Received: from localhost (unknown [47.90.47.25]) by esmtp4.qq.com (ESMTP) with id ; Mon, 20 Feb 2017 17:03:32 +0800 (CST) X-QQ-SSF: 01100000002000F0F820000A0000000 X-QQ-FEAT: vusB/7NFgTvSzggJVBbsTfM1EJIT52uW2KBgsJicEbGtffawK9J2L+jvtPY8q tPK2Y/6eWTLtC1aySTpiYmlXiGktoRYWFrg27ScnNWU+zuVdrEKinRKi7WRxZKgc0i6Gk0w QqJHM4mgrTX+RVSJclfc+VfCH9ltSFZnLIJGav8apA9lBsdfr1UUYbm9gkXO/l3gF46AZV1 bEmIeYwwnMKJrRHo739vUcwwk9mW6bbbwIlWZ4Dg+Te5TPKnpJr4L90xiXXuv+H/RI2YrDB jhyQ== X-QQ-GoodBg: 0 From: Steven Liu To: ffmpeg-devel@ffmpeg.org Date: Mon, 20 Feb 2017 17:03:30 +0800 Message-Id: <20170220090330.8558-1-lq@chinaffmpeg.org> X-Mailer: git-send-email 2.10.1.382.ga23ca1b.dirty X-QQ-SENDSIZE: 520 X-QQ-Bgrelay: 1 Subject: [FFmpeg-devel] [PATCH] avformat/hlsenc: fix cid 1401346 Dereferencing pointer error 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" check if proto is null before av_strcasecmp CID: 1401346 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 e673f59..fad6cae 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -668,7 +668,7 @@ static void hls_free_segments(HLSSegment *p) static void set_http_options(AVFormatContext *s, AVDictionary **options, HLSContext *c) { const char *proto = avio_find_protocol_name(s->filename); - int http_base_proto = !av_strcasecmp(proto, "http") || !av_strcasecmp(proto, "https"); + int http_base_proto = proto ? (!av_strcasecmp(proto, "http") || !av_strcasecmp(proto, "https")) : 0; if (c->method) { av_dict_set(options, "method", c->method, 0);