From patchwork Thu Nov 10 21:24:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1377 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.90.1 with SMTP id o1csp1071506vsb; Thu, 10 Nov 2016 13:24:41 -0800 (PST) X-Received: by 10.194.52.8 with SMTP id p8mr6200111wjo.38.1478813081138; Thu, 10 Nov 2016 13:24:41 -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 lz10si7148463wjb.276.2016.11.10.13.24.40; Thu, 10 Nov 2016 13:24:41 -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; dkim=neutral (body hash did not verify) header.i=@googlemail.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; dmarc=fail (p=QUARANTINE dis=NONE) header.from=googlemail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 8340E689EB1; Thu, 10 Nov 2016 23:24:35 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A1581689E72 for ; Thu, 10 Nov 2016 23:24:28 +0200 (EET) Received: by mail-wm0-f66.google.com with SMTP id u144so5572166wmu.0 for ; Thu, 10 Nov 2016 13:24:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=d7tmLLkBTQYP+fX7ec2C5615KydVBI1RqIkIEm3SgPk=; b=SuP7ezkdwxb7S61ilB8VGlOTJDcia1k3kdab1uUUPxOaOq+F17qov4wYrbWevNi9as tHFrXlBKxGrmWgkRtWchD8Aicw+UIck3PjEJFBrS87zX4xiswUAyOZf5JibuLfkRuPr0 HYr6CGE6i9zG0zTxTsOEuK7g0G1PfyjP70SMmDK2r+QQ1tW1DFH563vLNGdVXUc81NxX kfMAfNW0bvHOdkpgMelR9kY2roDV0NkIA29toWtvj4UOtndY/xIrTbrYTegezRepYa4C fDKm4hKf68n6/7Upp4yp9DQve3ERkOOw99x1YtP8yrY/vvuGt1uMSJQCkD7IWkDl4qSs l0Ug== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=d7tmLLkBTQYP+fX7ec2C5615KydVBI1RqIkIEm3SgPk=; b=TKNtyF8QM+ZinvALTE/awmWm7S7I4Sx+oHLfF/1gefF0ibmj0fXIxcaq2W9yukeHhy mwIF1OMQ7egq1MXtP82Ht8F/1gWwqXi/qRQjJuXpzdBK4TkuLD0Mi4PwcF6fXg+F4fSy Il2rkc7gi1RYlEpUEHs0mDYP1o0VENFx4wiibjGdIs9N+fn5Lr5Wb5ArbDcPSPSspX2O 6JCq13S9K9kltagamxTxn6X8eL7+fh+80w4pWxkRL4OdwHk+FeH0Xte0PxFhaHnMI9N9 4GAmUQ74AKyxgZMIR0GcydyGt2EzzJS3DZe56Z7ZrPTLq3LXydc3O4oj4m1T5t1Tvqgj d8BA== X-Gm-Message-State: ABUngvcDkrMCLTkn1w6HN0HUZedB21ST0YwQs/VKDbRDyNtMsaPkaj46d+w1Zri1qdmVag== X-Received: by 10.28.31.65 with SMTP id f62mr8881468wmf.108.1478813071686; Thu, 10 Nov 2016 13:24:31 -0800 (PST) Received: from [192.168.2.21] (pD9E8ED50.dip0.t-ipconnect.de. [217.232.237.80]) by smtp.googlemail.com with ESMTPSA id o62sm8369018wmg.9.2016.11.10.13.24.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Nov 2016 13:24:31 -0800 (PST) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches Message-ID: <4e7111c8-6fee-164f-9dd0-5ffcc9cfdbe8@googlemail.com> Date: Thu, 10 Nov 2016 22:24:30 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH] sbgdec: prevent NULL 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Andreas Cadhalpun --- libavformat/sbgdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/sbgdec.c b/libavformat/sbgdec.c index bb020d7..cbedd12 100644 --- a/libavformat/sbgdec.c +++ b/libavformat/sbgdec.c @@ -927,7 +927,7 @@ static void expand_timestamps(void *log, struct sbg_script *s) } } if (s->start_ts == AV_NOPTS_VALUE) - s->start_ts = s->opt_start_at_first ? s->tseq[0].ts.t : now; + s->start_ts = (s->opt_start_at_first && s->tseq) ? s->tseq[0].ts.t : now; s->end_ts = s->opt_duration ? s->start_ts + s->opt_duration : AV_NOPTS_VALUE; /* may be overridden later by -E option */ cur_ts = now;