From patchwork Fri Dec 16 02:34:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1826 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp1093734vsa; Thu, 15 Dec 2016 18:34:51 -0800 (PST) X-Received: by 10.194.157.3 with SMTP id wi3mr480403wjb.0.1481855691258; Thu, 15 Dec 2016 18:34:51 -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 r3si1254641wmd.81.2016.12.15.18.34.50; Thu, 15 Dec 2016 18:34:51 -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 D9C29689B6A; Fri, 16 Dec 2016 04:34:42 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wj0-f195.google.com (mail-wj0-f195.google.com [209.85.210.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 22982689B23 for ; Fri, 16 Dec 2016 04:34:36 +0200 (EET) Received: by mail-wj0-f195.google.com with SMTP id j10so12451789wjb.3 for ; Thu, 15 Dec 2016 18:34:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=0/TwgArPKAg81Vs6ebdBTb8JNLYUeOm31TBd4X7CXpU=; b=Y7WdQbRS/VYFj2bQ7omCJEU9ySaCSnkiFxoK7IxDX3WVjUPXe6EolVnjbV6j8xZ1b0 o3TA0gYznMaeEFpqCvfc816R4PDXDJZG3cUtBfI41rHAo7bGMOiPk97tRxp9ao0NW/4P wGznaGKc82taS5JZrYqF6y3ZhiGnAFS5qVOIhM/gA9gEKALYTlpYOZNTjZlp5LEu4uVy oRdSqPDRN/IIE0Sizx4tU4/vlfhnPY+ZoCHqPyBRz/dk9L9D1RMzoBWfb18Ry6Tt4g5v g+ycjrnB/i4j4vAbIF0tgoiST2mDuBdxBiU3wmHhFlWjz4cQpJGTOfdGLAaKCRo/CflH jWOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=0/TwgArPKAg81Vs6ebdBTb8JNLYUeOm31TBd4X7CXpU=; b=gF8fRjA0DW521dNrk/KesVQ7HH4iL7T+bfyN9SG3A2IBgOmYFOP/F/OIpewV1uM1ak 0wmujNtioMYZHXhatENNnMtucXP/S8yVvaibYd6cOmEnYFKw3oblDta8qldTdyaVVg3F F7/B3vxbSePS1gRvMAXcKDQySVa1aGEBPIADAF03Uids487LwYeI+HNfHS0dsyOVZJYo w/GDCUJuaSC0FyzKk/uT3+PZ9CZz9AsTxiiLkMgsVcA2PBirBe8kY38210gNGW9Y/8qg X+w/OpjQFnvAg764i2BkHuJu0VIOp/sf+USG2nPg3oO3VpDxrsQe+3aWnCJxoJ0G5pHX JhsA== X-Gm-Message-State: AIkVDXJTOkr2a+gbITwQIMOl+q/WWLmeYjyX5wyoWOLir1YoRoqDC1MDr6OPxEZqR6YCvQ== X-Received: by 10.194.11.105 with SMTP id p9mr461349wjb.139.1481855681898; Thu, 15 Dec 2016 18:34:41 -0800 (PST) Received: from [192.168.2.21] (pD9E8E08E.dip0.t-ipconnect.de. [217.232.224.142]) by smtp.googlemail.com with ESMTPSA id 81sm1208360wmw.7.2016.12.15.18.34.41 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 18:34:41 -0800 (PST) From: Andreas Cadhalpun X-Google-Original-From: Andreas Cadhalpun To: FFmpeg development discussions and patches References: <9663f686-48d6-0d43-ce9b-848b467366be@googlemail.com> Message-ID: <4bfe4cbe-2762-61bc-9b2e-0e5e2fc7eb00@googlemail.com> Date: Fri, 16 Dec 2016 03:34:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.4.0 MIME-Version: 1.0 In-Reply-To: <9663f686-48d6-0d43-ce9b-848b467366be@googlemail.com> Subject: [FFmpeg-devel] [PATCH 6/7] nistspheredec: prevent overflow during block alignment calculation 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/nistspheredec.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/nistspheredec.c b/libavformat/nistspheredec.c index 782d1df..b5ebcb8 100644 --- a/libavformat/nistspheredec.c +++ b/libavformat/nistspheredec.c @@ -80,6 +80,7 @@ static int nist_read_header(AVFormatContext *s) avpriv_set_pts_info(st, 64, 1, st->codecpar->sample_rate); + FF_BAIL_ON_OVERFLOW(s, st->codecpar->channels && st->codecpar->bits_per_coded_sample > INT_MAX / st->codecpar->channels) st->codecpar->block_align = st->codecpar->bits_per_coded_sample * st->codecpar->channels / 8; if (avio_tell(s->pb) > header_size)