From patchwork Fri Dec 16 02:32:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Cadhalpun X-Patchwork-Id: 1822 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp1093079vsa; Thu, 15 Dec 2016 18:32:52 -0800 (PST) X-Received: by 10.194.124.162 with SMTP id mj2mr440834wjb.111.1481855571932; Thu, 15 Dec 2016 18:32: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 a186si1246175wma.80.2016.12.15.18.32.51; Thu, 15 Dec 2016 18:32: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 A7D7D680CC1; Fri, 16 Dec 2016 04:32:43 +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 7D195680CC1 for ; Fri, 16 Dec 2016 04:32:37 +0200 (EET) Received: by mail-wm0-f66.google.com with SMTP id u144so2089200wmu.0 for ; Thu, 15 Dec 2016 18:32:44 -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=gx1WPFLGELVJCcVPaAMmf68DKO29yIIieVmIMaZg6io=; b=jsaFScTJp9jjBnCNg3CdhXX20aTFaEZEnJXp5wmcWSAab8/ot1tVGUrJ99auIIb+Nl tAdRUe8F0/SdePr/3sRfz/yrnggV26kdyv2OUytGfo7hIWqDxUhTx8cSiqGOJQqlsi7n hC8g8X4c4fZHIvhfTywHeYWtMa+x7S93fSQvf9ozkg+qXbTaz0RgWn3olOozqyGCHshF t1dOO7NGak2+HRhAIrIy1/4PDGXQMmxiJFK5zJGSM/NzRyG0MTINMUi2eojELvbKMJp+ pR0MHNKQpO5aECaHlBDb+uGL9H+RM6GxoeoR03u3pJptvL9wYyTbxtGmbBvoD4RxbdIU wSIA== 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=gx1WPFLGELVJCcVPaAMmf68DKO29yIIieVmIMaZg6io=; b=hh717PlaGrNszBs0ffihEQMoUJQa2SQ/Njpz84kkE1Gszuw0a6sPfs3z4Y/pcCykJZ HZc0Hi7PokrqoRIJOUVo18r/fmYAg9rfOg6KFPUdjCW6d5pAEs6RgzGGkzGZ9x+egNOg 03Aeo8/v3MTlJXJLQjvir/bSptpxrXy38OZe2GpJh3S6kS8svKU6KPaEN6nb5N8hJfwV Cpk1wAxRBGXMnZiQ7/SKKT27zcPhlHKwsaJlP7m1S7WJ1XdW0PsKyxfWIXMDbEaG3MaE SLHlzHy5fCwJ+B23xXdWH+qIayLiINGwLTqSOhZBBL7iFwmQE3/tbJFPRlEaB4dYZ+T4 +juQ== X-Gm-Message-State: AIkVDXLtlbR+jQbYkWLOu86nlQj81xroI3bIkzbpzDCZzi43q7ZnHXn94WCi8Uk7hE+9Tg== X-Received: by 10.28.113.76 with SMTP id m73mr501108wmc.114.1481855563355; Thu, 15 Dec 2016 18:32:43 -0800 (PST) Received: from [192.168.2.21] (pD9E8E08E.dip0.t-ipconnect.de. [217.232.224.142]) by smtp.googlemail.com with ESMTPSA id d64sm1200331wmh.3.2016.12.15.18.32.42 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 15 Dec 2016 18:32:42 -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: Date: Fri, 16 Dec 2016 03:32:42 +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 2/7] 4xm: 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/4xm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 2758b69..9332f78 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -187,6 +187,7 @@ static int parse_strk(AVFormatContext *s, st->codecpar->bit_rate = (int64_t)st->codecpar->channels * st->codecpar->sample_rate * st->codecpar->bits_per_coded_sample; + 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->channels * st->codecpar->bits_per_coded_sample;