From patchwork Fri Mar 30 05:09:01 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Dixit, Vishwanath" X-Patchwork-Id: 8239 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.1.70 with SMTP id c67csp2483644jad; Thu, 29 Mar 2018 22:09:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx499CggmKSujyCoh3UH5U167EkrngY2s7oeuyIJp7Ekuh3nFg1xvRVtfPiwpjGfcaCe/F6HS X-Received: by 10.223.150.56 with SMTP id b53mr8919043wra.79.1522386562456; Thu, 29 Mar 2018 22:09:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522386562; cv=none; d=google.com; s=arc-20160816; b=jM//vpZFjpm0sEKqgb7LbTA3QLz7dj0Y5gaiAiDKFOg8DXdhEaYwchUVSdkx3pvCcK 5McYV+BMvN43loRoNGCg3BhFPzdRf/5QB3zjxzirsefPkYAu5p+JXupxxpuLZ58nWkNH r30TsnsQk5w4VFxBCXp38aXIQigvjGSz6k2kV6YNOEB9+XgUI8B6zEQFJMjFfDYirasU vfmDniHzMlkbQnEIin8Mv1XXHPTRkEjerGQ5qZkCOYL5QX2647oA6ttBt6kFs4TrwDfy mJzZs5vb1AcSc4nL4dCyrxwp9YGsUE9SBGuUmWBdysg2bB+3VDO8l3rES01FAfeKv6u+ /1Fw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:feedback-id:message-id:date:to:from :dkim-signature:delivered-to:arc-authentication-results; bh=J34q0wMiK09jDGeyQOExynOY1GngdUVshp3mYXDoHnM=; b=flJ7o4OZxFX/zzLrv5rpkuRq9T6I9vvO3FHJ5kxC9zBr38Q2WVLwbloAFYlBTwzGqo JvCivdUfT06M7twfw/Xne0RFblUpE4Ozbb1cdiIQQ9E4ACKEY8FwKi3WdLz47wzmla03 1IYCHQIeJ3oybdGr4TZC472QApJsYv3qYxjm/K0smpOO+TCiWpwKiAgpB7OK079xnV8F Wy6ANnbXyvWONu83hccdhCg+5ubPAJZGeGYqzzHDffPaK8lVcODOyIznUh9B27OjOTAd M9OovW0PKIqQF/MMICXjh+ehvhrJQZd2wif+oYVnH2hCVy5RM9y6lT9j7ob5IFzh9xff m6mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=kGL/PS4v; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id l202si2435804wmd.194.2018.03.29.22.09.22; Thu, 29 Mar 2018 22:09:22 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@smtpservice.net header.s=m78bu0.a1-4.dyn header.b=kGL/PS4v; 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; dmarc=fail (p=QUARANTINE sp=NONE dis=NONE) header.from=akamai.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 38646689F95; Fri, 30 Mar 2018 08:08:56 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from a2i831.smtp2go.com (a2i831.smtp2go.com [103.47.207.63]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id CFAA6689CCB for ; Fri, 30 Mar 2018 08:08:48 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpservice.net; s=m78bu0.a1-4.dyn; x=1522387453; h=Feedback-ID: X-Smtpcorp-Track:Message-Id:Date:Subject:To:From:Reply-To:Sender: List-Unsubscribe; bh=4tqKbxCfNag70g1S+l38MHX17rgQIXp7y9aDBwt0HtU=; b=kGL/PS4v axEmx/b+RpDKIPBoMo4koouwZjiWrPhelhCG8rxq2ARysFhEEipYiQCnfGOMNmVVyzInJW3ooKQHQ zzIZmjLWVf0HEm7gv0Lj+yv4BSr1XNwYEIa43c6iZbB/4uEI48pBdquDd5R/RCMklXs81agMzsOpe p+o2y2IH49GwsinliGKxy46MOR7eFiIZ15uykiZ/RJ5MVzZzssk4vkP7pcyk7/T/aC4mXB2C0hfkC NwLHl7moj+ePCg+FKzq0+2Pjo2FyIpb0GAPKDfhBVAElAvx20nTK7u9FqA1bASV9pZ4zMu1EdRl+R jvgCY2CbeA1TmWfPauSyN/WCpQ==; From: vdixit@akamai.com To: ffmpeg-devel@ffmpeg.org Date: Fri, 30 Mar 2018 10:39:01 +0530 Message-Id: <1522386541-16549-1-git-send-email-vdixit@akamai.com> X-Mailer: git-send-email 1.9.1 X-Smtpcorp-Track: 1f1XHg4baDDCE-.vYZxgKyhi Feedback-ID: 337386m:337386asVRLGB:337386svcWBRx7RK:SMTPCORP X-Report-Abuse: Please forward a copy of this message, including all headers, to Subject: [FFmpeg-devel] [PATCH 7/8] avformat/hlsenc: check for null context to avoid uninitialized pointer access 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: Vishwanath Dixit MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Vishwanath Dixit Under error conditions, when the context is null, the application crashes without this check. --- libavformat/hlsenc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c index 1dd196f..334720f 100644 --- a/libavformat/hlsenc.c +++ b/libavformat/hlsenc.c @@ -2318,7 +2318,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt) } vs->packets_written++; - ret = ff_write_chained(oc, stream_index, pkt, s, 0); + if (oc->pb) + ret = ff_write_chained(oc, stream_index, pkt, s, 0); return ret; }